Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fix PM2 Deploy
  • Loading branch information
hijohnnylin committed Nov 7, 2019
1 parent 6d91344 commit dbcdf19bf81f6fd8b39d90ef1f412fb051326c2c
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/partner/*
mkdir -p /home/node/logs
@@ -1,5 +1,7 @@
#!/bin/bash

set -x

cd /home/node/partner
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/partner
# 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 -i max --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 dbcdf19

Please sign in to comment.