Hello,
According to the atlassian/serverless-deploy:1.2.0 (https://bitbucket.org/atlassian/serverless-deploy/src/master/), to set different Serverless configuration file we should define CONFIG param.
CONFIG: 'serverless.ts'
However, I've got this config:
image: atlassian/default-image:3
pipelines:
pull-requests:
master:
- step:
name: Deploy to Production
deployment: Production
script:
- pipe: atlassian/serverless-deploy:1.0.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CONFIG: 'serverless.ts'
EXTRA_ARGS: '--stage production --verbose'
But I still get the following error.
Hello @Antonio Lopes and welcome to the Community!
The error message indicates the pipe was not able to find a file with that name.
Could you please confirm if you have created a serverless.ts file in the root directory of your repository on the branch that is running the pipeline?
If you are creating this file during the build time, make sure that it's created in the folder BITBUCKET_CLONE_DIR as this is the directory that will be mounted inside the pipe's container.
Thank you, @Antonio Lopes !
Patrik S
Hey @Patrik S thanks for your reply.
Yes, the serverless.ts is in the root directory. Take a look, please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Antonio Lopes ,
Thanks for the confirmation!
Could you try to provide the path with ./ in front of the file name, and the file name between double quotes :
CONFIG: "./serverless.ts"
Also, you can add an ls -la command right before the pipe in your step's script to confirm if the file is present in the directory :
script:
- ls -la
- pipe: atlassian/serverless-deploy:1.0.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CONFIG: 'serverless.ts'
EXTRA_ARGS: '--stage production --verbose'
Thank you, @Antonio Lopes !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Patrik S
The line ls -la helped me to realize that all the serverless stuff was in a different branch, while the yaml file was in master (master doesn't have any serverless settings yet). That's why it didn't find the serverless file.
Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.