Pipeline Build is Failing - Deploy to S3 Step

Grab Qpons October 11, 2020

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

0 votes
Pritam Kumar October 11, 2020

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.

Grab Qpons October 12, 2020

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}
-
Kishore Gottumukkala October 13, 2020

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
AUG Leaders

Atlassian Community Events