Skip to content

Commit d49acf0

Browse files
fix(CI): define more variables locally (#212)
1 parent f9d85a0 commit d49acf0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def pr_gcs_bucket = "gs://workflow-cli-pr"
121121
def master_gcs_bucket = "gs://workflow-cli-master"
122122

123123
def upload_artifacts = { String dist_dir, String auth_id, String bucket, boolean cache ->
124-
headers = "-h 'x-goog-meta-git-branch:${git_branch}' "
124+
def headers = "-h 'x-goog-meta-git-branch:${git_branch}' "
125125
headers += "-h 'x-goog-meta-git-sha:${git_commit}' "
126126
headers += "-h 'x-goog-meta-ci-job:${env.JOB_NAME}' "
127127
headers += "-h 'x-goog-meta-ci-number:${env.BUILD_NUMBER}' "
@@ -130,7 +130,7 @@ def upload_artifacts = { String dist_dir, String auth_id, String bucket, boolean
130130
headers += ' -h "Cache-Control:no-cache"'
131131
}
132132

133-
script = "sh -c 'echo \${GCS_KEY_JSON} | base64 -d - > /tmp/key.json "
133+
def script = "sh -c 'echo \${GCS_KEY_JSON} | base64 -d - > /tmp/key.json "
134134
script += "&& gcloud auth activate-service-account -q --key-file /tmp/key.json "
135135
script += "&& gsutil -mq ${headers} cp -a public-read -r /upload/* ${bucket}'"
136136

@@ -144,7 +144,7 @@ def upload_artifacts = { String dist_dir, String auth_id, String bucket, boolean
144144
def mktmp = {
145145
// Create tmp directory to store files
146146
sh 'mktemp -d > tmp_dir'
147-
tmp = readFile('tmp_dir').trim()
147+
def tmp = readFile('tmp_dir').trim()
148148
echo "Storing binaries in ${tmp}"
149149
sh 'rm tmp_dir'
150150
return tmp

0 commit comments

Comments
 (0)