Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,946
Community Members
 
Community Events
165
Community Groups

How do I push only the changed files to S3?

So when files are being edit or changes are made and edit in a bitbucket repository, how can I push only the changes, is there a way or pipeline to do so?

1 answer

Mike Green, hi. It's a good case to use pipe: aws-s3-deploy, which under the hood run: aws s3 sync command.

 

Try this in your pipeline configuration:

script:
  - pipe: atlassian/aws-s3-deploy:1.1.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      AWS_DEFAULT_REGION: 'us-east-1'
      S3_BUCKET: 'my-bucket-name'
      LOCAL_PATH: 'build'

Cheers.

This pipe only push all the files to S3 bucket, but we only want to push the changed files only to the S3 bucket. Is there a way to do that?

According to docs i provided previously: aws s3 sync recursively copies new and updated files from the source directory to the destination.

This pipe logic:

run aws s3 sync ${LOCAL_PATH} s3://${S3_BUCKET}/ ${ARGS_STRING[@]} ${AWS_DEBUG_ARGS}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,218 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you