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

Pipeline deploy to Elasticbeanstalk - Upload issue - No changes reflected

Regtify March 19, 2019

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 ? 

3 answers

1 accepted

0 votes
Answer accepted
Lava Kumar Dukanam _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2019

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

Regtify March 20, 2019

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)
Lava Kumar Dukanam _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2019

Hi, 

Can you confirm if the S3 bucket and the EBS are in the same region?

Regtify March 20, 2019

Yes confirmed.

Regtify March 20, 2019

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:4e280f00cb5d1c53b3a36d24b129fbede2b1396e0d9d1d8d98398390a62a81bcStatus: 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.....

Lava Kumar Dukanam _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2019
Regtify March 20, 2019

Thanks! The AWS code worked whereas the Bitbucket code needs a lot of work,,

0 votes
Regtify March 21, 2019

-

methodeprog September 18, 2019

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

0 votes
mwatson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2019

The atlassian/aws-elasticbeanstalk-deploy pipe takes your zip you have built locally, and can work in 3 modes:

  • use the command upload-only to upload an artifact to S3 and create a version
  • use the command deploy-only to deploy an already created version to an environment
  • with no command , do the upload and deploy in one step

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)

Regtify March 21, 2019

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...

mwatson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 25, 2019

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

Regtify March 28, 2019

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events