Skip to content

Commit 5b0906a

Browse files
authored
Merge pull request #129 from lemeurherve/fixup
fixup: set env vars for aws s3 sync
2 parents 83707f2 + 6b5f988 commit 5b0906a

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

Jenkinsfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,23 @@ node('linux') {
7373
string(credentialsId: 'aws-access-key-id-updatesjenkinsio', variable: 'AWS_ACCESS_KEY_ID'),
7474
string(credentialsId: 'aws-secret-access-key-updatesjenkinsio', variable: 'AWS_SECRET_ACCESS_KEY')
7575
]) {
76-
sh '''
77-
azcopy sync updates/ "${UPDATES_FILE_SHARE_URL}" --exclude-path '.svn' --recursive=true
76+
withEnv([
77+
'AWS_DEFAULT_REGION=auto',
78+
'UPDATES_R2_BUCKETS=westeurope-updates-jenkins-io',
79+
'UPDATES_R2_ENDPOINT=https://8d1838a43923148c5cee18ccc356a594.r2.cloudflarestorage.com',
80+
]) {
81+
sh '''
82+
azcopy sync updates/ "${UPDATES_FILE_SHARE_URL}" --exclude-path '.svn' --recursive=true --delete-destination=true
7883
79-
## Note: AWS CLI are configured through environment variables (from Jenkins credentials) - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
80-
export AWS_DEFAULT_REGION="auto"
81-
aws s3 sync updates/ s3://"${UPDATES_R2_BUCKETS}"/ \
82-
--no-progress \
83-
--no-follow-symlinks \
84-
--size-only \
85-
--exclude '.svn' \
86-
--endpoint-url "${UPDATES_R2_ENDPOINT}"
87-
'''
84+
## Note: AWS CLI are configured through environment variables (from Jenkins credentials) - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
85+
aws s3 sync updates/ s3://"${UPDATES_R2_BUCKETS}"/ \
86+
--no-progress \
87+
--no-follow-symlinks \
88+
--size-only \
89+
--exclude '.svn' \
90+
--endpoint-url "${UPDATES_R2_ENDPOINT}"
91+
'''
92+
}
8893
}
8994
}
9095
}

0 commit comments

Comments
 (0)