Scalabull / get-tested-covid19

Open source code for community-driven, US-focused COVID-19 test locator database.
https://get-tested-covid19.org
MIT License
7 stars 18 forks source link

CI Deployment, Robustness #30

Closed zboldyga closed 4 years ago

zboldyga commented 4 years ago

CI/CD deployment via Buddy is having some trouble, failing. The startup command is failing: "server:start": "pm2 stop all && pm2 start ecosystem.config.js", Fail log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'server:start' ]
2 info using npm@6.13.4
3 info using node@v12.16.1
4 verbose run-script [ 'preserver:start', 'server:start', 'postserver:start' ]
5 info lifecycle get-tested-covid19@1.1.0~preserver:start: get-tested-covid19@1.1.0
6 info lifecycle get-tested-covid19@1.1.0~server:start: get-tested-covid19@1.1.0
7 verbose lifecycle get-tested-covid19@1.1.0~server:start: unsafe-perm in lifecycle true
8 verbose lifecycle get-tested-covid19@1.1.0~server:start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/testSiteApp/get-tested-covid19/node_modules/.bin:/home/testSiteApp/.local/bin:/home/testSiteApp/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
9 verbose lifecycle get-tested-covid19@1.1.0~server:start: CWD: /home/testSiteApp/get-tested-covid19
10 silly lifecycle get-tested-covid19@1.1.0~server:start: Args: [ '-c', 'pm2 stop all && pm2 start ecosystem.config.js' ]
11 silly lifecycle get-tested-covid19@1.1.0~server:start: Returned: code: 1  signal: null
12 info lifecycle get-tested-covid19@1.1.0~server:start: Failed to exec server:start script
13 verbose stack Error: get-tested-covid19@1.1.0 server:start: `pm2 stop all && pm2 start ecosystem.config.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:311:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:311:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid get-tested-covid19@1.1.0
15 verbose cwd /home/testSiteApp/get-tested-covid19
16 verbose Linux 4.18.0-147.5.1.el8_1.x86_64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "server:start"
18 verbose node v12.16.1
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error get-tested-covid19@1.1.0 server:start: `pm2 stop all && pm2 start ecosystem.config.js`
22 error Exit status 1
23 error Failed at the get-tested-covid19@1.1.0 server:start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

This may be because of the 'pm2 stop all' command.

Overall, we should carefully think through the deployment. e.g. understand PM2's production deployment guidelines, and look at how others are using this w/ CI tools: https://codeburst.io/automate-your-deployment-process-with-pm2-b0fd7c256223 .

zboldyga commented 4 years ago

@tiagojsalmeida Any chance you can help with this? I'm way behind on work 🤦‍♂

tiagojsalmeida commented 4 years ago

Done ✅