Skip to content

Commit

Permalink
[beats-tester][packaging] store artifacts also in another predictable…
Browse files Browse the repository at this point in the history
… location
  • Loading branch information
v1v committed Oct 16, 2020
1 parent 47862a1 commit 5190cb3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .ci/beats-tester.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ pipeline {
options { skipDefaultCheckout() }
when { branch 'master' }
steps {
// TODO: to use the git commit that triggered the upstream build
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT")
}
}
stage('Build *.x branch') {
options { skipDefaultCheckout() }
when { branch '*.x' }
steps {
// TODO: to use the git commit that triggered the upstream build
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT")
}
}
Expand All @@ -84,6 +86,7 @@ pipeline {
}
}
steps {
// TODO: to use the git commit that triggered the upstream build
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT")
}
}
Expand Down
18 changes: 15 additions & 3 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,22 @@ def publishPackages(baseDir){
bucketUri = "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}"
}
def beatsFolderName = getBeatsName(baseDir)
googleStorageUpload(bucket: "${bucketUri}/${beatsFolderName}",
uploadPackages("${bucketUri}/${beatsFolderName}", baseDir, beatsFolderName)

// In order to run the beats-tester let's copy those files to another more predictable
// location where those files won't be uploaded while running the beats-tester
if (isBranch()) {
bucketUri = "gs://${JOB_GCS_BUCKET}/commit/${env.GIT_BASE_COMMIT}"
uploadPackages("${bucketUri}/${beatsFolderName}", baseDir, beatsFolderName)
}
}

def uploadPackages(bucketUri, baseDir, beatsFolderName){
def distributionsFolder = 'build/distributions'
googleStorageUpload(bucket: bucketUri,
credentialsId: "${JOB_GCS_CREDENTIALS}",
pathPrefix: "${baseDir}/build/distributions/",
pattern: "${baseDir}/build/distributions/**/*",
pathPrefix: "${baseDir}/${distributionsFolder}/",
pattern: "${baseDir}/${distributionsFolder}/**/*",
sharedPublicly: true,
showInline: true
)
Expand Down

0 comments on commit 5190cb3

Please sign in to comment.