Skip to content

Commit

Permalink
�chore : jenkins 보안 경고를 반영해서 withEnv로 환경변수 처리하도록 변경
Browse files Browse the repository at this point in the history
eqvyoo authored Nov 3, 2024
1 parent 8a5e19b commit d7cb7d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -48,15 +48,17 @@ pipeline {

stage('Deploy to S3') {
steps {
sh "aws s3 sync build/ s3://${S3_BUCKET} --delete --region ${REGION}"
withEnv(["S3_BUCKET=${S3_BUCKET}", "REGION=${REGION}"]) {
sh 'aws s3 sync build/ s3://$S3_BUCKET --delete --region $REGION'
}
}
}

stage('Invalidate CloudFront Cache') {
steps {
sh """
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/*" --region ${REGION}
"""
withEnv(["DISTRIBUTION_ID=${DISTRIBUTION_ID}", "REGION=${REGION}"]) {
sh 'aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*" --region $REGION'
}
}
}
}

0 comments on commit d7cb7d7

Please sign in to comment.