Skip to content

Commit c543e2d

Browse files
committed
fix: rename env variable
1 parent d77d259 commit c543e2d

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazon/aws-cli:2.8.9
1+
FROM amazon/aws-cli:2.8.11
22

33
ADD entrypoint.sh /entrypoint.sh
44
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
| S3_DESTINATION_DIR | false (defaults to S3 root) | Path to folder in a S3 bucket |
5252
| CLOUDFRONT_DISTRIBUTION_ID | false | Your CloudFront distribution |
5353
| CLOUDFRONT_PATHS | false (defaults to /*) | The paths to invalidate (relative to the distribution) |
54-
| USE_GZIP | false (defaults to false) | Use gzip for upload |
54+
| USE_GZIP_COMPRESSION | false (defaults to false) | Use gzip for upload |

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ services:
1212
- S3_SOURCE_DIR
1313
- CLOUDFRONT_DISTRIBUTION_ID
1414
- CLOUDFRONT_PATHS
15+
- USE_GZIP_COMPRESSION

entrypoint.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,24 @@ if [ -z "$S3_SOURCE_DIR" ]; then
2929
exit 1
3030
fi
3131

32-
if [ "$USE_GZIP" = true ]; then
32+
if [ "$USE_GZIP_COMPRESSION" = true ]; then
3333
echo "Gzipping files..."
34-
find "$PWD/$S3_SOURCE_DIR" -type f -exec gzip "{}" \; -exec mv "{}.gz" "{}" \;
34+
echo "./$S3_SOURCE_DIR"
35+
echo "$PWD/$S3_SOURCE_DIR"
36+
echo "$(pwd)/S3_SOURCE_DIR"
37+
38+
touch test.md
39+
40+
ls -la $S3_SOURCE_DIR
41+
42+
ls -la
43+
44+
find "./$S3_SOURCE_DIR" -type f -exec gzip "{}" \; -exec mv "{}.gz" "{}" \;
3545
fi
3646

37-
sh -c "aws s3 sync $S3_SOURCE_DIR s3://$AWS_S3_BUCKET/$DESTINATION_DIR $([ "$USE_GZIP" = true ] && echo "--content-encoding gzip" || echo "") $*"
47+
echo "Uploading files..."
48+
49+
sh -c "aws s3 sync $S3_SOURCE_DIR s3://$AWS_S3_BUCKET/$DESTINATION_DIR $([ "$USE_GZIP_COMPRESSION" = true ] && echo "--content-encoding gzip" || echo "") $*"
3850

3951
if [ -n "$CLOUDFRONT_DISTRIBUTION_ID" ]; then
4052
echo "Creating CloudFront invalidation"

0 commit comments

Comments
 (0)