0

Here is my root folder and i want to deploy AWS Lambda functions to codecommit from the Backend folder.

enter image description here

Therefore i wrote this command, but AWS CodeBuild gives this error (This command can only be run in a Serverless service directory).

version: 0.1

phases:
    install:
        commands:
            - npm install -g serverless@1.20.2
    post_build:
        commands:
            - cd Backend
            - serverless deploy --region eu-west-1 --verbose 

How can i deploy it from the backend folder?

Edit: I forgot to edit the version. Now i changed it to version: 0.2 and it works fine.

Adam Jungen
  • 407
  • 2
  • 7
  • 23

2 Answers2

0

can you change to

 - cd Backend && serverless deploy --region eu-west-1 --verbose 
BMW
  • 42,880
  • 12
  • 99
  • 116
0

I forgot to edit the version of buildspec.yml. Now i changed it to version: 0.2 and it works fine.

version: 0.2

phases:
    install:
        commands:
            - npm install -g serverless@1.20.2
    post_build:
        commands:
            - cd Backend
            - serverless deploy --region eu-west-1 --verbose 
Adam Jungen
  • 407
  • 2
  • 7
  • 23