Hi,
We would like to zip our branch repository and upload to S3 on every commit.
We tried to use "aws-code-deploy" pipe and we were able to upload a zip successfully but the pipe fails as we don't have anything to deploy.
Do we have any pipe which just uploads a zip to S3 and not deploy OR
Can we turn off deploy in "aws-code-deploy" pipe?
Appreciate your help.
Thanks.
There's an aws-s3-deploy pipe. Documentation: https://bitbucket.org/atlassian/aws-s3-deploy/src/master/README.md
Here's an example usage:
- pipe: atlassian/aws-s3-deploy:0.3.1
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: 'name_of_your_bucket'
LOCAL_PATH: 'path/to/your/files'
Hi Daniel,
Thanks for the response. I checked the pipe but couldn’t find how to zip before uploading to S3. Any idea how we can zip with this pipe?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you need to zip up a bunch of files, you need to create the zip as part of the step. For example:
- step:
name: Upload to S3
script:
- mkdir dist
- zip dist/myzip.zip file1 file2 file3
- pipe: atlassian/aws-s3-deploy:0.3.1
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: 'name_of_your_bucket'
LOCAL_PATH: 'dist'
Depending on the build container image that you're using, if may not have the zip utility, you would have to install it if it doesn't exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally got it working!
We need to include artifacts with "dist/**".
Here's the working version:
- step:
name: Upload to S3
script:
- mkdir dist
- zip dist/myzip.zip file1 file2 file3
- artifacts:
- dist/**
- pipe: atlassian/aws-s3-deploy:0.3.1
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: 'name_of_your_bucket'
LOCAL_PATH: 'dist'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.