Skip to content

Commit

Permalink
Fix msitools installation for packaging pipeline (#39005)
Browse files Browse the repository at this point in the history
* Test packaging

* Moved msitool to earlier install phase

* Moved msitool to earlier install phase

* fix: run within the withBeatsEnv context

* Cleanup

* Inline the msitool script

* Removed arm docker build step from agentbeat

---------

Co-authored-by: Victor Martinez <[email protected]>
  • Loading branch information
pazone and v1v authored Apr 17, 2024
1 parent 5bc43ff commit 1ade6d2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def generateSteps() {
'heartbeat',
'metricbeat',
'packetbeat',
'x-pack/agentbeat',
'x-pack/auditbeat',
'x-pack/dockerlogbeat',
'x-pack/filebeat',
Expand Down Expand Up @@ -282,9 +281,6 @@ def generateLinuxStep(beat) {
withEnv(["HOME=${env.WORKSPACE}", "PLATFORMS=${linuxPlatforms()}", "BEATS_FOLDER=${beat}"]) {
withGithubNotify(context: "Packaging Linux ${beat}") {
deleteDir()
if (beat.equals('x-pack/agentbeat') || beat.equals('x-pack/osquerybeat')) {
sh(label: 'install msitools', script: '.buildkite/scripts/install-msitools.sh')
}
release('snapshot')
dir("${BASE_DIR}"){
pushCIDockerImages(arch: 'amd64')
Expand Down Expand Up @@ -382,6 +378,16 @@ def release(type){
withEnv([
"DEV=${!type.equals('staging')}"
]) {
dir("${BASE_DIR}"){
if (env.BEATS_FOLDER.equals('x-pack/agentbeat') || env.BEATS_FOLDER.equals('x-pack/osquerybeat')) {
// sh(label: 'install msitools', script: '.buildkite/scripts/install-msitools.sh')
sh '''#!/usr/bin/env bash
set -euo pipefail
sudo apt-get update -y
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends --yes msitools
'''
}
}
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
dir("${env.BEATS_FOLDER}") {
sh(label: "mage package ${type} ${env.BEATS_FOLDER} ${env.PLATFORMS}", script: 'mage package')
Expand Down Expand Up @@ -451,4 +457,4 @@ def notifyStatus(def args = [:]) {
to: "${env.NOTIFY_TO}",
subject: subject,
body: "Build: (<${env.RUN_DISPLAY_URL}|here>).\n ${body}")
}
}

0 comments on commit 1ade6d2

Please sign in to comment.