Skip to content

Commit

Permalink
[CI] Job to delete all review apps (#1279) (#1280)
Browse files Browse the repository at this point in the history
The code changes will delete the review-apps' folder on dokku EC2 instance if its folder still exists while cleaning up all review-apps.

Co-authored-by: Prashant Khadka <[email protected]>
Co-authored-by: Don Restarone <[email protected]>
  • Loading branch information
donrestarone and Prashant Khadka authored Dec 6, 2022
1 parent df6e13b commit 1380b4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/dokku-clean-review-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ jobs:
dokku postgres:exists "${APP_NAME}-db" && dokku postgres:destroy "${APP_NAME}-db" --force;
dokku redis:exists "${APP_NAME}-redis" && dokku redis:destroy "${APP_NAME}-redis" --force;
if [ -d /home/dokku/$APP_NAME ]; then
echo "Folder of ${APP_NAME} still exists.\nDeleting it manually.";
sudo rm -rf /home/dokku/$APP_NAME;
[ -d /home/dokku/$APP_NAME ] && echo "Could not delete ${APP_NAME}." || echo "${APP_NAME} deleted successfully.";
fi
echo "Deletion of ${APP_NAME} app, ${APP_NAME}-db and ${APP_NAME}-redis completed.";
};
done;

0 comments on commit 1380b4a

Please sign in to comment.