Skip to content

Commit 597f75a

Browse files
CHORE: update deploy.sh
CHORE: update deploy.sh
2 parents 882b29d + 333df93 commit 597f75a

3 files changed

Lines changed: 15 additions & 20 deletions

File tree

โ€Žappspec.ymlโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ permissions:
2222
group: ubuntu
2323

2424
hooks:
25-
AfterInstall:
26-
- location: scripts/stop.sh
27-
timeout: 180
28-
runas: ubuntu
2925
ApplicationStart:
3026
- location: scripts/deploy.sh
3127
timeout: 180
32-
runas: ubuntu
28+
runas: ubuntu

โ€Žscripts/deploy.shโ€Ž

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
REPOSITORY=/home/ubuntu/qcard
1+
REPOSITORY=/home/ubuntu/app
22
cd $REPOSITORY
33

4-
echo "> ๋ฐฐํฌ"
5-
sudo docker-compose up -d
4+
CURRENT_CONTAINER=$(sudo docker ps -aq --filter "name=qcard")
5+
6+
if [ -z $CURRENT_CONTAINER ]
7+
then
8+
echo "> ํ˜„์žฌ ์‹คํ–‰์ค‘์ธ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค."
9+
else
10+
echo "> kill $CURRENT_CONTAINER"
11+
sudo docker rm -f $CURRENT_CONTAINER
12+
sudo docker rmi $CURRENT_CONTAINER
13+
fi
14+
15+
sudo docker build -t qcard .
16+
sudo docker run -d -p 80:8080 --name qcard --network app qcard

โ€Žscripts/stop.shโ€Ž

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
ย (0)