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

serverless-deploy:1.2.0 doesn't find serverless.ts

Antonio Lopes June 4, 2023

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.

Screenshot 2023-06-04 at 20.10.05.png

 

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2023

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

Antonio Lopes June 27, 2023

Hey @Patrik S thanks for your reply.

Yes, the serverless.ts is in the root directory. Take a look, please

Screenshot 2023-06-27 at 16.24.56.png

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 29, 2023

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

Antonio Lopes July 10, 2023

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.

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events