Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

I want to deploy to s3 with compression

I'm using atlassian/aws-s3-deploy pipeline to deploy to s3, and using cloudfront

But sadly cloudfront doesnt compress images, so I'm wandering whether atlassian/aws-s3-deploy pipeline can compress and add encoding header

2 answers

1 accepted

0 votes
Answer accepted

Nvm,

 

I found the answer, I compress it myself 

find $(realpath ./build/static/images) -name "*" -type f -exec sh -c "gzip -c9 '{}' > '{}.gz'; mv '{}.gz' '{}'" \; 

 and deploy aws-s3-deploy with

CONTENT_ENCODING: 'gzip'

 the problematic need to careful is when I use extra args filtering

--exclude *

which work fine if I execute 

aws s3 sync

directly,

which somehow not exactly same as I expected in the pipe, then I need use 

DEBUG: 'true'

to see what's happen, and found it need to use this style

--exclude=*
0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 16, 2023

Hello @xicond ,

Thank you for reaching out to Atlassian Support.

What the pipe atlassian/aws-s3-deploy is essentially doing is executing the aws s3 sync command, with the arguments you pass as variables for the pipe.

Looking at AWS's CLI s3 sync documentation, it doesn't look to provide any argument to enable compressions of images, so I think this is not currently supported by that AWS command.

In this case, you would either have to execute the compression before executing the pipe atlassian/aws-s3-deploy , or implement something on AWS side, such as a Lambda function, to compress the images after they were uploaded. I found the following article that might be relevant to your use-case : 

Hope that helps! Let me know in case you have any questions.

Thank you, @xicond 

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events