Skip to content

Commit

Permalink
ci(codedeploy): be extra sure container are shut down
Browse files Browse the repository at this point in the history
Appologies for the curn. Trying to track down a hopefully unrelated
deployment issue before release.
  • Loading branch information
djwhitt committed Dec 13, 2023
1 parent 8e19088 commit 4617281
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/codedeploy/app-start
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@

cd /opt/ar-io-node

# ensure containers are shut down
if [ "$(docker ps -q)" ]; then
docker-compose down
fi

# TODO use a pre-built image
docker-compose up -d
5 changes: 5 additions & 0 deletions scripts/codedeploy/before-install
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
mkdir -p /efs/backups/$instance_id/sqlite/previous-before-install
mkdir -p /efs/backups/$instance_id/sqlite/before-install

# ensure containers are shut down
if [ "$(docker ps -q)" ]; then
docker-compose down
fi

# keep an archive of the previous backup in case the copy fails
if [ "$(ls /efs/backups/$instance_id/before-install/*.db)" ]; then
mv /efs/backups/$instance_id/before-install/* /efs/backups/$instance_id/previous-before-install/
Expand Down

0 comments on commit 4617281

Please sign in to comment.