mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:35:49 +00:00
20230706
This commit is contained in:
parent
d2e47adbac
commit
05154e0851
3 changed files with 40 additions and 0 deletions
20
appspec.yml
Normal file
20
appspec.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
version: 0.0
|
||||
os: linux
|
||||
files:
|
||||
- source: /
|
||||
destination: /home/ubuntu
|
||||
overwrite: yes
|
||||
permission:
|
||||
- object: /home/ubuntu
|
||||
pattern: "**"
|
||||
owner: ubuntu
|
||||
group: ubuntu
|
||||
hooks:
|
||||
ApplicationStop:
|
||||
- location: kill_process.sh
|
||||
timeout: 100
|
||||
runas: ubuntu
|
||||
ApplicationStart:
|
||||
- location: run_process.sh
|
||||
timeout: 3600
|
||||
runas: ubuntu
|
5
scripts/kill_process.sh
Normal file
5
scripts/kill_process.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Remove existed container"
|
||||
docker-compose -f /home/ec2-user/docker-compose.yml down || true
|
||||
|
15
scripts/run_process.sh
Normal file
15
scripts/run_process.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
REGION="ap-northeast-2"
|
||||
ACCOUNT_ID="257307634175"
|
||||
ECR_REPOSITORY="${ACCOUNT_ID}.dkr.ecr.ap-northeast-2.amazonaws.com"
|
||||
ECR_DOCKER_IMAGE="${ECR_REPOSITORY}/spring-petclinic"
|
||||
ECR_DOCKER_TAG="1.0"
|
||||
|
||||
aws ecr get-login-password --region ${REGION} \
|
||||
| docker login --username AWS --password-stdin ${ECR_REPOSITORY};
|
||||
|
||||
export IMAGE=${ECR_DOCKER_IMAGE};
|
||||
export TAG=${ECR_DOCKER_TAG};
|
||||
docker-compose -f /home/ubuntu/docker-compose.yml up -d;
|
||||
|
Loading…
Reference in a new issue