Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

pipeline not able to find the file in repository

justin.weeks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2019

I'm trying to deploy an AWS CloudFormation template, located in my repo, from Pipelines. I came across this Docker image at bitbucketpipelines/aws-cloudformation-deploy.

When deploying the following template:

image: bitbucketpipelines/aws-cloudformation-deploy:latest

pipelines:
default:
- step:
name: Deploy with CF
services:
- docker
script:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
- export STACK_NAME=$STACK_NAME
- export TEMPLATE=$TEMPLATE
- docker run -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION -e STACK_NAME=$STACK_NAME -e TEMPLATE=$TEMPLATE bitbucketpipelines/aws-cloudformation-deploy

where $TEMPLATE is the location in the repo (testdir/test.template.json), I get the following error:

INFO: Using stack template from testdir/test.template.json for deploy.
x Not able to find the file testdir/test.template.json in your repository

This doesn't make sense, since it's saying it can't find the file but yet links directly to it when I click the link found in the above error.

I've tried every variation of the path to this file to no avail. Thoughts?

 

1 answer

1 accepted

1 vote
Answer accepted
Raul Gomis
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2019

Hey @justin.weeks ,

Thanks for your reaching out! We haven't released the aws-cloudformation-deploy pipe officially yet, so I wouldn't recommend using it for a critical service deployment yet. 


However, your script is not working because you are not mounting the build directory into the docker containers and not setting the working directory to the proper one. This is how you can do it.

pipelines:
default:
- step:
services:
- docker
script:
- docker run
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
-e STACK_NAME=$STACK_NAME
-e TEMPLATE=$TEMPLATE
-w $(pwd)
-v $(pwd):$(pwd)
bitbucketpipelines/aws-cloudformation-deploy

The aws-cloudformation-deploy pipe will be released in the next few days, so I would recommend using the proper syntax once it is released. For more information you can check our public docs: https://confluence.atlassian.com/bitbucket/pipes-958765631.html

Regards,

Raul 

justin.weeks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 24, 2019

Thanks @Raul Gomis !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events