Skip to content

Commit

Permalink
[ci] 설정파일 백업 로직 작성
Browse files Browse the repository at this point in the history
설정파일 백업 로직 작성
  • Loading branch information
YeaChan05 committed Jun 19, 2024
1 parent f39390b commit bf32201
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ permissions:
- file

hooks:
BeforeInstall:
- location: scripts/backup.sh
timeout: 60
runas: ec2-user

ApplicationStop:
- location: scripts/stop.sh
timeout: 60
Expand All @@ -42,3 +47,8 @@ hooks:
- location: scripts/deploy.sh
timeout: 600
runas: ec2-user

AfterInstall:
- location: scripts/restore.sh
timeout: 60
runas: ec2-user
4 changes: 4 additions & 0 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

mkdir -p /home/ec2-user/cicd/backup
cp /home/ec2-user/cicd/src/main/resources/application-prod.yml /home/ec2-user/cicd/backup/
5 changes: 5 additions & 0 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

if [ -f /home/ec2-user/cicd/backup/application-prod.yml ]; then
cp /home/ec2-user/cicd/backup/application-prod.yml /home/ec2-user/cicd/src/main/resources/application-prod.yml
fi

0 comments on commit bf32201

Please sign in to comment.