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

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

Pipeline Build is Failing - Deploy to S3 Step

My build is failing with error "The user-provided path /tmp/artifact.zip does not exist.✖ Failed to upload /tmp/artifact.zip to S3."

Can you please advise what is missing out in my steps?

---- Below is the snippet of my bitbucket-pipelines.yml --------

 

Screen Shot 2020-10-11 at 10.49.14 PM.png

1 answer

Hello @Grab Qpons ,

Without looking at output of previous steps I can't guide much but look at error there might be some issue in artifact generation in 'Build and Compress' step.

Hello @Pritam Kumar ,

Please see below and let me know if it helps. Appreciate your help

 

--- 
image: "node:7.3.0"
pipelines:
tags:
latest:
- step:
image: "atlassian/pipelines-awscli:latest"
services:
- docker
script:
- IMAGE="${AWS_REGISTRY_URL}/grabqpons-api-gateway"
- TAG=${BITBUCKET_BRANCH:-$BITBUCKET_TAG}
- "echo $TAG"
- "export TAG=`git describe --abbrev=0 --tags`"
- "echo $TAG"
- "export TAG='latest'"
- "echo $TAG"
- aws configure set aws_access_key_id "${AWS_ACCESS_KEY_ID}"
- aws configure set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
- eval $(aws ecr get-login --no-include-email --region "${AWS_DEFAULT_REGION}" | sed 's;https://;;g')
- docker build -t $IMAGE:$TAG .
- docker push $IMAGE:$TAG
branches:
dev:
-
step:
image: "atlassian/default-image:2"
name: "Build and Compress Code"
script:
- "cd /opt/atlassian/pipelines/agent/build"
- pwd
- "ls -al"
- "rm -rf node_modules"
- "zip -r /tmp/artifact.zip *"
- pwd
- "ls -al"
-
step:
name: "Upload artifact (code) to AWS S3"
script:
- pipe: atlassian/aws-code-deploy:0.2.10
variables:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
COMMAND: 'upload'
APPLICATION_NAME: ${APPLICATION_NAME}
ZIP_FILE: '/tmp/artifact.zip'
S3_BUCKET: ${S3_BUCKET}
-
step:
image: "atlassian/pipelines-awscli:latest"
name: "Deploy code to AWS EC2"
services:
- docker
script:
- pipe: atlassian/aws-code-deploy:0.2.10
variables:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
COMMAND: 'deploy'
APPLICATION_NAME: ${APPLICATION_NAME}
DEPLOYMENT_GROUP: ${DEPLOYMENT_GROUP}
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
WAIT: 'true'
S3_BUCKET: ${S3_BUCKET}
-

Hello there,

Appreciate it if anyone of you can help in identifying the problem.

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

110 views 1 8
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