Guys I am having issues deploying to elasticbeanstalk. It seems that when running the pipeline it just duplicates the existing zip file within the s3 bucket. Tried various scenarios but still get the same result.
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: 'applicationXYZ'
ENVIRONMENT_NAME: 'Test'
ZIP_FILE: 's3://elasticbeanstalk-us-west-x-xxxxxxxxxx/applicationXYZ.zip'
S3_BUCKET: 'elasticbeanstalk-us-west-x-xxxxxxxxxx'
Any suggestions ?
Hi @Regtify ,
Couple of things you can do.
1. What happens when you don't have any zip contents in s3 bucket and perform a 'upload-only'? Do you see the latest code is being uploaded?
2. Add 'version' key to the variables and see if that make any difference
3. Add 'debug':true so you will have more information about what's going on.
Let me know how it goes.
Thanks,
Lava
Thank you for the reply!
I tried to perform point 1 and it stops saying: INFO: Uploading to s3 bucket: reg-bitbucketXYZ...
fatal error: An error occurred (404) when calling the HeadObject operation: Key "applicationXYZ.zip" does not exist
Based on this conf:
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: 'applicationXYZ'
COMMAND: 'upload-only'
ENVIRONMENT_NAME: 'Test'
ZIP_FILE: 's3://reg-bitbucketXYZ/applicationXYZ.zip'
S3_BUCKET: 'reg-bitbucketXYZ'
DEBUG: 'TRUE'
VERSION_LABEL: ${ENVIRONMENT_NAME}_${BITBUCKET_COMMIT:0:8}_YYYY-mm-dd_HHMMSS)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you confirm if the S3 bucket and the EBS are in the same region?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the support. I also just tried the following:
1. Uploaded the zip file to the bucket
2. Edited the code to:
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: 'applicationXYZ'
COMMAND: 'upload-only'
ENVIRONMENT_NAME: 'Test'
ZIP_FILE: 's3://applicationXYZ-elasticbeanstalk-deployment/applicationXYZ-app.zip'
S3_BUCKET: 'applicationXYZ-elasticbeanstalk-deployment'
DEBUG: 'TRUE'
3. Run the pipeline with success but again the same problem, i.e. the new file created in the bucket is exactly the same as the old one but with different version name. I checked to see if the changes that I have made have been reflected in the new zip file but unfortunately it is identical to the original zip.
Digest: sha256:4e280f00cb5d1c53b3a36d24b129fbede2b1396e0d9d1d8d98398390a62a81bc
Status: Downloaded newer image for bitbucketpipelines/aws-elasticbeanstalk-deploy:0.2.5
INFO: Uploading to s3 bucket: applicationXYZ-elasticbeanstalk-deployment...
Completed 680.3 KiB/32.7 MiB (860.5 KiB/s) with 1 file(s) remaining
Completed 8.7 MiB/32.7 MiB (9.7 MiB/s) with 1 file(s) remaining
Completed 16.7 MiB/32.7 MiB (17.5 MiB/s) with 1 file(s) remaining
Completed 24.7 MiB/32.7 MiB (24.6 MiB/s) with 1 file(s) remaining
Completed 32.7 MiB/32.7 MiB (30.7 MiB/s) with 1 file(s) remaining
copy: s3://applicationXYZ-elasticbeanstalk-deployment/applicationXYZ-app.zip to s3://applicationXYZ-elasticbeanstalk-deployment/applicationXYZ-102-eb15a3fd.zip
✔ Artifact uploaded successfully to s3://applicationXYZ-elasticbeanstalk-deployment/applicationXYZ-102-eb15a3fd.zip
I am quite lost, after trying 100 different combinations.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry!
You may want to try without a pipe.
see this https://medium.com/@avishayil/deploy-to-elastic-beanstalk-using-bitbucket-pipelines-189eb75cf052
and the corresponding repository
https://bitbucket.org/awslabs/aws-elastic-beanstalk-bitbucket-pipelines-python/src/master/
more pipelines examples:
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.
Hi value team member
I need your help on this deployment
//////////
- step:
# caches:
# - composer
name: Deploy to Test
deployment: test # set to test
trigger: automatic
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
APPLICATION_NAME: 'AAAAAAAAA'
ZIP_FILE: 's3://AAAAAAAAA-elasticbeanstalk-deployment/AAAAAAAAA-app.zip'
S3_BUCKET: 'AAAAAAAAA-elasticbeanstalk-deployment'
COMMAND: 'upload-only'
ENVIRONMENT_NAME: 'test'
DEBUG: 'TRUE'
VERSION_LABEL: ${ENVIRONMENT_NAME}_${BITBUCKET_COMMIT:0:8}_YYYY-mm-dd_HHMMSS)
/////////////
I got this
INFO: The application source bundle doesn't have a known file extension (zip, jar or war). This might cause some issues.INFO: Uploading to s3 bucket: AAAAAAAAA-elasticbeanstalk-deployment...fatal error: An error occurred (404) when calling the HeadObject operation: Key "AAAAAAAAA-app.zip" does not exist
If you could help !
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The atlassian/aws-elasticbeanstalk-deploy pipe takes your zip you have built locally, and can work in 3 modes:
It looks like you have already uploaded an artifact and are trying to create a new version or deploy an existing version?
Your workflow may not map exactly through to the 2 workflows that we support, or you could modify it so that you build your zip in pipelines, use the upload-only command and then have deployment steps in pipelines that deploys that artifact to your different environments.
Hope this helps,
Matt Watson (Bitbucket Pipelines DevMgr)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Matt,
Thank you for the support! We have committed the yml file 100+ times with different combinations, including the 3 command options and a zip step before... The problem is still the same, it creates a file that is exactly the same as the one previously uploaded. If we do not upload the zip file, the pipeline pops an error saying the the file does not exist in s3...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Constantinos,
The Pipe is not intended to be used with a zip file already in S3 - the S3 bucket is merely the intermediate storage for the artefact you generate and zip up within Pipelines. you then upload_only it and use 1 or more deploy-only pipes to push that artefact to different environments. See https://bitbucket.org/bitbucketpipelines/example-aws-elasticbeanstalk-deploy/src/master/bitbucket-pipelines.yml for a fully worked example.
Hope that helps,
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Matt,
When we first tried using pipelines we kept getting this message:
INFO: Uploading to s3 bucket: xxxxxxx-elasticbeanstalk-deployment...
The user-provided path xxx.zip does not exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.