Skip to content
Permalink
Browse files
Fix PM2 Deploy
  • Loading branch information
hijohnnylin committed Nov 7, 2019
1 parent 682dad2 commit 29ce016b47715dd45769b834d89d7b022cd3aadf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
@@ -1,4 +1,6 @@
#!/bin/bash

set -x

rm -rf /home/node/renewer/*
mkdir -p /home/node/logs
@@ -1,5 +1,7 @@
#!/bin/bash

set -x

cd /home/node/renewer
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
@@ -1 +1,3 @@
set -x

at -M now + 2 minute <<< $'service codedeploy-agent restart'
@@ -1,10 +1,11 @@
#!/bin/bash

set -x

export NODE_ENV=production

cd /home/node/renewer
# Update PM2
pm2 updatePM2
pm2 update
env PATH=$PATH:/usr/local/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u node --hp /home/node
pm2 delete all
pm2 start index.js --merge-logs --log ../logs/app.log
@@ -1,5 +1,10 @@
#!/bin/bash

set -x

npm install -g n
n 10
npm install -g npm
npm install -g npm

# Install latest pm2
npm install -g pm2

0 comments on commit 29ce016

Please sign in to comment.