Skip to content

Commit b936d18

Browse files
authored
Revert "Revert "[CI] googleStorageUploadExt step (#24048)" (#25454) (#25461)"
This reverts commit b807fdb.
1 parent 31bf406 commit b936d18

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

.ci/packaging.groovy

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pipeline {
1717
JOB_GCS_BUCKET = 'beats-ci-artifacts'
1818
JOB_GCS_BUCKET_STASH = 'beats-ci-temp'
1919
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
20+
JOB_GCS_EXT_CREDENTIALS = 'beats-ci-gcs-plugin-file-credentials'
2021
DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod'
2122
DOCKER_REGISTRY = 'docker.elastic.co'
2223
GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests'
@@ -470,14 +471,11 @@ def publishPackages(baseDir){
470471
uploadPackages("${bucketUri}/${beatsFolderName}", baseDir)
471472
}
472473

473-
def uploadPackages(bucketUri, baseDir){
474-
googleStorageUpload(bucket: bucketUri,
475-
credentialsId: "${JOB_GCS_CREDENTIALS}",
476-
pathPrefix: "${baseDir}/build/distributions/",
477-
pattern: "${baseDir}/build/distributions/**/*",
478-
sharedPublicly: true,
479-
showInline: true
480-
)
474+
def uploadPackages(bucketUri, beatsFolder){
475+
googleStorageUploadExt(bucket: bucketUri,
476+
credentialsId: "${JOB_GCS_EXT_CREDENTIALS}",
477+
pattern: "${beatsFolder}/build/distributions/**/*",
478+
sharedPublicly: true)
481479
}
482480

483481
/**
@@ -532,4 +530,4 @@ def fixPermissions() {
532530
}
533531
}
534532
}
535-
}
533+
}

Jenkinsfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pipeline {
1515
DOCKER_REGISTRY = 'docker.elastic.co'
1616
JOB_GCS_BUCKET = 'beats-ci-temp'
1717
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
18+
JOB_GCS_EXT_CREDENTIALS = 'beats-ci-gcs-plugin-file-credentials'
1819
OSS_MODULE_PATTERN = '^[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*'
1920
PIPELINE_LOG_LEVEL = 'INFO'
2021
PYTEST_ADDOPTS = "${params.PYTEST_ADDOPTS}"
@@ -386,13 +387,10 @@ def publishPackages(beatsFolder){
386387
* @param beatsFolder the beats folder.
387388
*/
388389
def uploadPackages(bucketUri, beatsFolder){
389-
googleStorageUpload(bucket: bucketUri,
390-
credentialsId: "${JOB_GCS_CREDENTIALS}",
391-
pathPrefix: "${beatsFolder}/build/distributions/",
390+
googleStorageUploadExt(bucket: bucketUri,
391+
credentialsId: "${JOB_GCS_EXT_CREDENTIALS}",
392392
pattern: "${beatsFolder}/build/distributions/**/*",
393-
sharedPublicly: true,
394-
showInline: true
395-
)
393+
sharedPublicly: true)
396394
}
397395

398396
/**
@@ -787,12 +785,12 @@ def archiveTestOutput(Map args = [:]) {
787785
* disk space of the jenkins instance
788786
*/
789787
def tarAndUploadArtifacts(Map args = [:]) {
790-
tar(file: args.file, dir: args.location, archive: false, allowMissing: true)
791-
googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${env.JOB_NAME}-${env.BUILD_ID}",
792-
credentialsId: "${JOB_GCS_CREDENTIALS}",
793-
pattern: "${args.file}",
794-
sharedPublicly: true,
795-
showInline: true)
788+
def fileName = args.file.replaceAll('[^A-Za-z-0-9]','-')
789+
tar(file: fileName, dir: args.location, archive: false, allowMissing: true)
790+
googleStorageUploadExt(bucket: "gs://${JOB_GCS_BUCKET}/${env.JOB_NAME}-${env.BUILD_ID}",
791+
credentialsId: "${JOB_GCS_EXT_CREDENTIALS}",
792+
pattern: "${fileName}",
793+
sharedPublicly: true)
796794
}
797795

798796
/**

0 commit comments

Comments
 (0)