2023-05-09 18:03:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
echo "-------------------------"
|
|
|
|
echo "Expiring deleted projects"
|
|
|
|
echo "-------------------------"
|
|
|
|
date
|
|
|
|
|
|
|
|
ENABLE_CRON_RESOURCE_DELETION=$(cat /etc/container_environment/ENABLE_CRON_RESOURCE_DELETION)
|
|
|
|
|
|
|
|
if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
|
|
|
|
echo "Skipping project expiration due to ENABLE_CRON_RESOURCE_DELETION not set to true"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-04-03 10:17:13 +00:00
|
|
|
WEB_URL='http://127.0.0.1:3000'
|
2023-05-09 18:03:46 +00:00
|
|
|
|
|
|
|
USER=$(cat /etc/container_environment/WEB_API_USER)
|
|
|
|
PASS=$(cat /etc/container_environment/WEB_API_PASSWORD)
|
|
|
|
|
|
|
|
curl -X POST -v -u "${USER}:${PASS}" \
|
|
|
|
"${WEB_URL}/internal/expire-deleted-projects-after-duration"
|
|
|
|
|
|
|
|
echo "Done."
|