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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to build pipeline and deploy to aws codedeploy

Hello,

I want to initiate deployment of bitbucket repo code to AWS codedeploy service after each commit. Which will then install it on EC2 instance based on tag values.

The EC2 instance will have linux, apache, php installed and there will be separate rds for mysql. 

Here is the pipeline yml file which i built from available documentation & its failing at uploading zip file to S3.

 

Need help in solving this error as well want to know where should be appspec.yml be placed

pipelines:
default:
- step:
name: Deploy to staging
deployment: staging #can be test,staging or production.
#trigger: manual #Comment to make it automatic
script:
- echo "Deploying to staging environment"

- pipe: atlassian/aws-code-deploy:0.2.3
variables:
AWS_DEFAULT_REGION: 'ap-southeast-1' # ap-southeast-1, us-east-1
AWS_ACCESS_KEY_ID: 'mykey'
AWS_SECRET_ACCESS_KEY: 'mysecretkey'
COMMAND: 'upload' # 'upload' or 'deploy'.
APPLICATION_NAME: 'myWeb'
ZIP_FILE: 'webstg.zip'
S3_BUCKET: 'webdevops'
VERSION_LABEL: 'web-stg-1.0.0'

- pipe: atlassian/aws-code-deploy:0.2.3
variables:
AWS_ACCESS_KEY_ID: 'mykey'
AWS_SECRET_ACCESS_KEY: 'mysecretkey'
AWS_DEFAULT_REGION: 'us-east-1' # ap-southeast-1, us-east-1
APPLICATION_NAME: 'myWeb'
COMMAND: 'deploy' # 'upload' or 'deploy'.
DEPLOYMENT_GROUP: 'staging'
WAIT: 'true'
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
S3_BUCKET: 'webdevops'
VERSION_LABEL: 'web-stg-1.0.0'

 

**********

Error

aws s3 cp webstg.zip s3://webdevops/web-stg-1.0.0The user-provided path webstg.zip does not exist.✖ Failed to upload webstg.zip to S3.

 

Thanks,

Santosh

1 answer

1 vote

Hi @Santosh Maid,

I can't see any commands prior to running the upload pipe that create the zip file you're trying to upload. The pipe doesn't create the zip, it will just take a zip file that already exists and upload it. 

You can create a zip file containing all the files you require as a command in the step before you run the pipes. This can be done with the zip program in linux. The basic command is

zip -r <zip file name> <files to zip>

For more information you can consult the documentation on https://linux.die.net/man/1/zip.

As long as you zip the file before running the pipe it should run correctly.

Cheers,

Tom

Nowhere in your pipeline documentation do you state this step is required. I've just wasted 2 days researching why my pipeline does not work. You really need to work on your documentation Atlassian ! From the way its written it looks like your script files do the zipping it doesn't mention needing an extra step anywhere !

Like # people like this

So how do we get hold of the files? When the docker runs where are the repository files?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,154 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you