serverless-deploy:1.2.0 doesn't find serverless.ts
Asked by Antonio Lopes:

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](https://community.atlassian.com/t5/image/serverpage/image-id/261204i34A33E73596CDA09/image-size/large?v=v2&px=999 "Screenshot 2023-06-04 at 20.10.05.png")


Answers:
author: Patrik S
body: Hello [@Antonio Lopes](/t5/user/viewprofilepage/user-id/5235112) 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](/t5/user/viewprofilepage/user-id/5235112) !

Patrik S

comments: author: Antonio Lopes
body: Hey [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) 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](https://community.atlassian.com/t5/image/serverpage/image-id/265377i1577DF047C9EB3FA/image-size/large?v=v2&px=999 "Screenshot 2023-06-27 at 16.24.56.png")


author: Patrik S
body: Hello [@Antonio Lopes](/t5/user/viewprofilepage/user-id/5235112) ,

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](/t5/user/viewprofilepage/user-id/5235112) !

Patrik S


author: Antonio Lopes
body: Hey [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

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.


Tags: bitbucket-cloud

cloud