I set up my website following the instructions here:

https://medium.com/@mabdullahabid/how-to-use-bitbucket-pipelines-for-continuous-deployment-to-amazon-s3-aeb4b3e1f282

I use S3 for my static files, and a bitbucket pipeline to automatically update when I push.

However, my blog is stores in a separate folder in s3 named "blog", within root.

My code itself has no directory named blog, but every time I push an update, the bitbucket pipeline seems to delete my "blog" directory on s3.

Does bitbucket completely rewrite the whole s3 repo and replace all the contents with contents from my git repo? How can I tell my pipeline and s3 "Update all files but leave /blog/ alone"

Here is my .yml file.

pipelines:
  branches:
    master:
      - step:
          script:
            - s3 --region "us-east-1" rm s3://example.com
            - s3 --region "us-east-1" sync . s3://example.com```

0 Answers