File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 51
51
| S3_DESTINATION_DIR | false (defaults to S3 root) | Path to folder in a S3 bucket |
52
52
| CLOUDFRONT_DISTRIBUTION_ID | false | Your CloudFront distribution |
53
53
| CLOUDFRONT_PATHS | false (defaults to /*) | The paths to invalidate (relative to the distribution) |
54
+ | USE_GZIP | false (defaults to false) | Use gzip for upload |
Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ if [ -z "$AWS_REGION" ]; then
24
24
exit 1
25
25
fi
26
26
27
- sh -c " aws s3 sync $S3_SOURCE_DIR s3://$AWS_S3_BUCKET /$DESTINATION_DIR $* "
27
+ if [ " $USE_GZIP " = true ]; then
28
+ echo " Gzipping files..."
29
+ find " $S3_SOURCE_DIR " -type f -exec gzip " {}" \; -exec mv " {}.gz" " {}" \;
30
+ fi
31
+
32
+ sh -c " aws s3 sync $S3_SOURCE_DIR s3://$AWS_S3_BUCKET /$DESTINATION_DIR $( [ " $USE_GZIP " = true ] && echo " --content-encoding gzip" || echo " " ) $* "
28
33
29
34
if [ -n " $CLOUDFRONT_DISTRIBUTION_ID " ]; then
30
35
echo " Creating CloudFront invalidation"
You can’t perform that action at this time.
0 commit comments