Missed Team ’24? Catch up on announcements here.

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

aws-codedeploy integration

amrsalah944 July 14, 2022

The BUNDLE_TYPE option is not working, I passed it tar, but when bitbucket calls codedeploy it pass it as zip

 

There is a bug in the pipe.py file, That if statement is wrong

 

 

if self.get_variable('BUNDLE_TYPE') in ['zip', 'tar', 'tgz']:
deploy_parameters.update({'fileExistsBehavior': self.get_variable('FILE_EXISTS_BEHAVIOR')})

https://bitbucket.org/atlassian/aws-code-deploy/src/master/

1 answer

0 votes
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2022

Hi @amrsalah944 

Thank you for your question!

It would be nice if you provide us your bitbucket-pipelines configuration to investigate the issue you reported.

 

Best regards,
Oleksandr Kyrdan

amrsalah944 July 17, 2022
Thanks for your reply!
my pipeline file is as below
pipelines:
branches:
dev:
- step:
deployment: test
script:
- pipe: atlassian/slack-notify:2.0.0
variables:
WEBHOOK_URL: $SLACK_WEBHOOK_URL
MESSAGE: 'Deployment to CRM-DEV initiated. All others will be paused until deployment complete.'
- tar -cf application.tar .

- pipe: atlassian/aws-code-deploy:0.2.5
variables:
BUNDLE_TYPE: "tar"
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME_DEV
S3_BUCKET: $S3_BUCKET_DEV
COMMAND: 'upload'
ZIP_FILE: 'application.tar'
region: us-east-2
DEBUG: 'true'
- pipe: atlassian/aws-code-deploy:0.2.5
variables:
BUNDLE_TYPE: "tar"
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME_DEV
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP_DEV
S3_BUCKET: $S3_BUCKET_DEV
COMMAND: 'deploy'
WAIT: 'true'
region: us-east-2
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
DEBUG: 'true'
- pipe: atlassian/slack-notify:2.0.0
variables:
WEBHOOK_URL: $SLACK_WEBHOOK_URL
MESSAGE: 'Deployment to CRM-DEV is live.'
-------------
even the var is exported, but the aws command end like that
--env=BUNDLE_TYPE="tar" \

++ aws deploy create-deployment --application-name web-dev --deployment-group CodeDeploy1 --revision 'revisionType=S3,s3Location={bucket=xxx-web-dev,bundleType=zip,key=web-dev-xxx}' --ignore-application-stop-failures --file-exists-behavior OVERWRITE
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2022

Hi @amrsalah944 

Thank you for your question!

Looks like you try to use outdated (0.2.5) pipe's version with a new (1.1.1) parameters:

Currently the latest pipe's version is 1.1.1:

script:
  - pipe: atlassian/aws-code-deploy:1.1.1
    variables:
      COMMAND: 'upload'
      APPLICATION_NAME: 'my-application'
      ZIP_FILE: 'myapp.zip'

Support for variable BUNDLE_TYPE has started since version 0.3.0. And it's always good idea to update the pipe to the latest version that includes new features, fixes, upgrades.

Best regards,
Oleksandr

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events