Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Error running the deployment from the CI/CD pipeline #62

Open
s1mrankaur opened this issue Mar 15, 2021 · 0 comments
Open

Error running the deployment from the CI/CD pipeline #62

s1mrankaur opened this issue Mar 15, 2021 · 0 comments

Comments

@s1mrankaur
Copy link

s1mrankaur commented Mar 15, 2021

In serverless.yml file, the default profile name is 'sandbox'.

When running sls deploy command and not passing --profile argument, it automatically tries to use the sandbox profile.

profile: ${opt:profile, 'sandbox'}

Now, In package.json at the root of the application folder that the CI/CD pipeline needs to deploy, we have,

"deploy:cicd": " lerna run deploy --stream",

This will run the deploy command in all of the serverless services.

In package.json of each of the services, I have:
"deploy": "sls deploy -v",

When the command, npm run deploy:cicd is run, it throws

  1. profile not found error when I run deploy command from build.sh
  2. If I add deploy in deploy.sh, I instead get

lerna run deploy --stream
--
51 |  
52 | internal/modules/cjs/loader.js:834
53 | throw err;
54 | ^
55 |  
56 | Error: Cannot find module '.'
57 | Require stack:
58 | - /codebuild/output/src163111865/src/node_modules/.bin/lerna
59 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
60 | at Function.Module._load (internal/modules/cjs/loader.js:687:27)
61 | at Module.require (internal/modules/cjs/loader.js:903:19)
62 | at require (internal/modules/cjs/helpers.js:74:18)
63 | at Object. (/codebuild/output/src163111865/src/node_modules/.bin/lerna:11:3)
64 | at Module._compile (internal/modules/cjs/loader.js:1015:30)
65 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
66 | at Module.load (internal/modules/cjs/loader.js:879:32)
67 | at Function.Module._load (internal/modules/cjs/loader.js:724:14)
68 | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
69 | code: 'MODULE_NOT_FOUND',
70 | requireStack: [ '/codebuild/output/src163111865/src/node_modules/.bin/lerna' ]
71 | }
72 | npm ERR! code 1
73 | npm ERR! path /codebuild/output/src163111865/src
74 | npm ERR! command failed
75 | npm ERR! command sh -c lerna run deploy --stream
76 |  
77 | npm ERR! A complete log of this run can be found in:
78 | npm ERR! /root/.npm/_logs/2021-03-15T23_30_13_216Z-debug.log

@s1mrankaur s1mrankaur changed the title How can a profile be used for the deployment when using this CI/CD pipeline for deployment Error running the deployment from the CI/CD pipeline Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant