@@ -10,7 +10,6 @@ platform_type_lowercase="${platform_type,,}"
1010
1111SCRIPTS_BUILDKITE_PATH=" ${WORKSPACE} /.buildkite/scripts"
1212
13- GOOGLE_CREDENTIALS_FILENAME=" google-cloud-credentials.json"
1413export ELASTIC_PACKAGE_BIN=${WORKSPACE} /build/elastic-package
1514
1615API_BUILDKITE_PIPELINES_URL=" https://api.buildkite.com/v2/organizations/elastic/pipelines/"
@@ -253,34 +252,6 @@ with_github_cli() {
253252 gh version
254253}
255254
256- # # Logging and logout from Google Cloud
257- google_cloud_auth_safe_logs () {
258- local gsUtilLocation
259- gsUtilLocation=$( mktemp -d -p " ${WORKSPACE} " -t " ${TMP_FOLDER_TEMPLATE} " )
260- local secretFileLocation=${gsUtilLocation} /${GOOGLE_CREDENTIALS_FILENAME}
261-
262- echo " ${PRIVATE_CI_GCS_CREDENTIALS_SECRET} " > " ${secretFileLocation} "
263-
264- gcloud auth activate-service-account --key-file " ${secretFileLocation} " 2> /dev/null
265- export GOOGLE_APPLICATION_CREDENTIALS=${secretFileLocation}
266- }
267-
268- google_cloud_logout_active_account () {
269- local active_account
270- active_account=$( gcloud auth list --filter=status:ACTIVE --format=" value(account)" 2> /dev/null || true)
271- if [[ -n " $active_account " && -n " ${GOOGLE_APPLICATION_CREDENTIALS+x} " ]]; then
272- echo " Logging out from GCP for active account"
273- gcloud auth revoke " $active_account " > /dev/null 2>&1
274- else
275- echo " No active GCP accounts found."
276- fi
277-
278- if [ -n " ${GOOGLE_APPLICATION_CREDENTIALS+x} " ]; then
279- rm -rf " ${GOOGLE_APPLICATION_CREDENTIALS} "
280- unset GOOGLE_APPLICATION_CREDENTIALS
281- fi
282- }
283-
284255# # Helpers for integrations pipelines
285256check_git_diff () {
286257 cd " ${WORKSPACE} "
@@ -918,16 +889,16 @@ upload_safe_logs() {
918889 local source=" $2 "
919890 local target=" $3 "
920891
892+ echo " --- Uploading safe logs to GCP bucket ${bucket} "
893+
921894 if ! ls ${source} 2>&1 > /dev/null ; then
922895 echo " upload_safe_logs: artifacts files not found, nothing will be archived"
923896 return
924897 fi
925898
926- google_cloud_auth_safe_logs
927-
928- gsutil cp ${source} " gs://${bucket} /buildkite/${REPO_BUILD_TAG} /${target} "
899+ gcloud storage cp ${source} " gs://${bucket} /buildkite/${REPO_BUILD_TAG} /${target} "
929900
930- google_cloud_logout_active_account
901+ echo " GCP logout is not required, the BK plugin will do it for us "
931902}
932903
933904clean_safe_logs () {
0 commit comments