FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
eks-workshop/codebuild-deploy.sh at main · qoolfly/eks-workshop · GitHub
qoolfly
eks-workshop
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
eks-workshop
/
codebuild-deploy.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
22 lines (18 loc) · 1.08 KB
Breadcrumbs
eks-workshop
/
codebuild-deploy.sh
Copy path
File metadata and controls
executable file
·
22 lines (18 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!
/bin/bash
set
-vex
[
-n
"
${PRIMARY_BUCKET}
"
]
||
exit
1
[
-n
"
${TEMPLATE_BUCKET}
"
]
||
exit
1
[
-n
"
${CODEBUILD_GIT_CLEAN_BRANCH}
"
]
||
exit
1
[
-n
"
${CLOUDFRONT}
"
]
||
exit
1
set
+vx
PRIMARY_BUCKET=
$(
echo
$PRIMARY_BUCKET
|
cut -f1,2 -d.
)
if
[
"
$CODEBUILD_GIT_CLEAN_BRANCH
"
=
"
master
"
]
;
then
aws s3 sync public/ s3://
${PRIMARY_BUCKET}
/ --cache-control
'
max-age=3600, public
'
--exclude
'
*
'
--include
'
*.html
'
--include
'
*.xml
'
;
aws s3 sync public/ s3://
${PRIMARY_BUCKET}
/ --cache-control
'
max-age=86400, public
'
--exclude
'
*.html
'
--exclude
'
*.xml
'
;
aws cloudfront create-invalidation --distribution-id
${CLOUDFRONT}
--paths /
\*
else
export
DEPLOY_DIR=
${CODEBUILD_GIT_CLEAN_BRANCH}
;
aws s3 sync public/ s3://
${PRIMARY_BUCKET}
/
${DEPLOY_DIR}
/ --delete --cache-control
'
max-age=3600, public
'
--exclude
'
*
'
--include
'
*.html
'
--include
'
*.xml
'
;
aws s3 sync public/ s3://
${PRIMARY_BUCKET}
/
${DEPLOY_DIR}
/ --delete --cache-control
'
max-age=86400, public
'
--exclude
'
*.html
'
--exclude
'
*.xml
'
;
aws cloudfront create-invalidation --distribution-id
${CLOUDFRONT}
--paths /
${DEPLOY_DIR}
\*
fi
Back
|
FazBrowse Home
|
New Git URL