Skip to content

Commit

Permalink
add clean_destination scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanglen committed May 31, 2024
1 parent 1d81df1 commit 41217ed
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion appspec-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ files:
destination: /home/ec2-user/django-indexer-dev
hooks:
BeforeInstall:
- location: "echo 'Cleaning up destination directory' && rm -rf /home/ec2-user/django-indexer-dev/*"
- location: scripts/clean_destination_dev.sh
timeout: 300
runas: ec2-user
AfterInstall:
Expand Down
4 changes: 4 additions & 0 deletions appspec-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ files:
destination: /home/ec2-user/django-indexer-testnet
hooks:
# # Install:
BeforeInstall:
- location: scripts/clean_destination_testnet.sh
timeout: 300
runas: ec2-user
AfterInstall:
- location: scripts/after_install_testnet.sh
timeout: 300
Expand Down
8 changes: 8 additions & 0 deletions scripts/clean_destination_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Directory to clean
DEST_DIR="/home/ec2-user/django-indexer-dev"

# Delete all contents of the destination directory
if [ -d "$DEST_DIR" ]; then
rm -rf "${DEST_DIR:?}/*"
fi
8 changes: 8 additions & 0 deletions scripts/clean_destination_testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Directory to clean
DEST_DIR="/home/ec2-user/django-indexer-testnet"

# Delete all contents of the destination directory
if [ -d "$DEST_DIR" ]; then
rm -rf "${DEST_DIR:?}/*"
fi

0 comments on commit 41217ed

Please sign in to comment.