Skip to content

Commit

Permalink
[Server] deploy : sh파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
mniYUNSU committed Aug 25, 2021
1 parent b1f10fe commit 9299ab2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/Jurimma

hooks:
ApplicationStop:
- location: scripts/stop.sh
runas: root
AfterInstall:
- location: scripts/initialize.sh
runas: root
ApplicationStart:
- location: scripts/start.sh
runas: root
9 changes: 9 additions & 0 deletions scripts/initialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
npm install
npm install pm2@latest -g
sudo apt-get update
sudo apt-get install authbind
sudo touch /etc/authbind/byport/80
sudo chown ubuntu /etc/authbind/byport/80
sudo chmod 755 /etc/authbind/byport/80
3 changes: 3 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
authbind --deep pm2 start app.js
4 changes: 4 additions & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
pm2 stop app.js 2> /dev/null || true
pm2 delete app.js 2> /dev/null || true

0 comments on commit 9299ab2

Please sign in to comment.