From a5b8c28ed4c9f2adda73fde9ca17c5387c950e71 Mon Sep 17 00:00:00 2001 From: mniYUNSU Date: Wed, 25 Aug 2021 12:02:37 +0900 Subject: [PATCH 1/2] :sparkles: backup#1 0825 --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2eea525..97aca2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.env \ No newline at end of file +.env +node_modules \ No newline at end of file From 9299ab2c5ff7bb522ecd97d4a78a0b116e202d82 Mon Sep 17 00:00:00 2001 From: mniYUNSU Date: Wed, 25 Aug 2021 14:23:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Server]=20deploy=20:=20sh=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appspec.yml | 16 ++++++++++++++++ scripts/initialize.sh | 9 +++++++++ scripts/start.sh | 3 +++ scripts/stop.sh | 4 ++++ 4 files changed, 32 insertions(+) create mode 100644 appspec.yml create mode 100644 scripts/initialize.sh create mode 100644 scripts/start.sh create mode 100644 scripts/stop.sh diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 0000000..7849fab --- /dev/null +++ b/appspec.yml @@ -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 diff --git a/scripts/initialize.sh b/scripts/initialize.sh new file mode 100644 index 0000000..26f4ba8 --- /dev/null +++ b/scripts/initialize.sh @@ -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 \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..038e4b4 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd /home/ubuntu/Jurimma/server +authbind --deep pm2 start app.js \ No newline at end of file diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100644 index 0000000..189516f --- /dev/null +++ b/scripts/stop.sh @@ -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 \ No newline at end of file