@@ -9,22 +9,25 @@ case $RABBY_GO_ENV in
99 regression|mobile-regression)
1010 RABBY_GO_ENV=" mobile-regression"
1111 echo " Deploying regression build..."
12- s3_dir=" mobile-regression"
12+ local_dir=" mobile-regression"
13+ s3_dir=" rabby-go/$local_dir "
14+ ;;
15+ debug|mobile-debug|* )
16+ RABBY_GO_ENV=" mobile-debug"
17+ echo " Deploying debug build..."
18+ local_dir=" mobile-debug"
19+ s3_dir=" rabby-go/$local_dir "
1320 ;;
1421 production|mobile-production)
1522 RABBY_GO_ENV=" mobile-production"
1623 echo " Deploying production build..."
17- s3_dir=" mobile"
24+ local_dir=" mobile"
25+ s3_dir=" rabby-go/$local_dir "
1826 # can_prune=false
1927 ;;
20- debug|mobile-debug|* )
21- RABBY_GO_ENV=" mobile-debug"
22- echo " Deploying debug build..."
23- s3_dir=" mobile-debug"
24- ;;
2528esac
2629
27- dist_dir=$project_dir /dist/$s3_dir ;
30+ dist_dir=$project_dir /dist/$local_dir ;
2831if [ -z $SKIP_BUILD ]; then
2932 rm -rf $dist_dir
3033 # ./node_modules/.bin/vite build --mode $RABBY_GO_ENV
@@ -44,24 +47,26 @@ if [ ! -z "$REALLY_UPLOAD" ]; then
4447 common_sync_options=" $common_sync_options --delete"
4548 fi
4649 # html
47- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.html" --content-type " text/html" $common_sync_options
50+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.html" --content-type " text/html" $common_sync_options
4851 # js
49- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.js" --content-type " application/javascript" $common_sync_options
52+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.js" --content-type " application/javascript" $common_sync_options
5053 # css
51- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.css" --content-type " text/css" $common_sync_options
54+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.css" --content-type " text/css" $common_sync_options
5255 # svg
53- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.svg" --content-type " image/svg+xml" $common_sync_options
56+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.svg" --content-type " image/svg+xml" $common_sync_options
5457 # png
55- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.png" --content-type " image/png" $common_sync_options
58+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.png" --content-type " image/png" $common_sync_options
5659 # jpeg/jpg
57- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.jpeg" --content-type " image/jpeg" $common_sync_options
58- aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /rabby-go/ $s3_dir / --exclude " *" --include " *.jpg" --content-type " image/jpeg" $common_sync_options
60+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.jpeg" --content-type " image/jpeg" $common_sync_options
61+ aws s3 sync $dist_dir / s3://${RABBY_MOBILE_BUILD_BUCKET} /$s3_dir / --exclude " *" --include " *.jpg" --content-type " image/jpeg" $common_sync_options
5962
60- if [ ! -z $RABBY_GO_CDN_FRONTEND_ID ]; then
61- echo " Automatically refresh CDN"
62- aws cloudfront create-invalidation --distribution-id $RABBY_GO_CDN_FRONTEND_ID --paths " /$s3_dir /*"
63- echo " CDN invalidation created"
64- fi
63+ # if [ ! -z $RABBY_GO_CDN_FRONTEND_ID ]; then
64+ # echo "Automatically refresh CDN"
65+ # aws cloudfront create-invalidation --distribution-id $RABBY_GO_CDN_FRONTEND_ID --paths "/$s3_dir/*"
66+ # echo "CDN invalidation created"
67+ # fi
68+ echo " You can refresh CDN by the command below"
69+ echo " aws cloudfront create-invalidation --distribution-id \$ RABBY_GO_CDN_FRONTEND_ID --paths " /$s3_dir /* " "
6570fi
6671
6772echo " Refresh by \` aws cloudfront create-invalidation --distribution-id \$ RABBY_GO_CDN_FRONTEND_ID --paths '/$s3_dir /*'\` "
0 commit comments