diff --git a/.releaserc b/.releaserc index bf47fdf..30a901b 100644 --- a/.releaserc +++ b/.releaserc @@ -6,6 +6,6 @@ plugins: [ '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', - '@semantic-release/github' + ['@semantic-release/github', { successCommentCondition: false, failCommentCondition: false }] ] } diff --git a/cleanup.bash b/cleanup.bash index b6cb3b4..e7eb215 100644 --- a/cleanup.bash +++ b/cleanup.bash @@ -26,18 +26,30 @@ delete_service() { if [[ "$http_code" == 2* ]]; then echo "Service deletion request accepted (HTTP ${http_code})" + elif [[ "$http_code" == 404 ]]; then + echo "Service already deleted (HTTP ${http_code})" else echo "Delete failed (HTTP ${http_code}): $(cat /tmp/delete_response.json)" + return 1 fi } +# Once the service is deleted, the instance keeps running (and being billed) until its +# open requests, like event streams, reach the request timeout: stop it right away +stop_instance() { + echo "Stopping instance" + supervisorctl -c /etc/supervisord.conf shutdown +} + while true; do sleep 30 response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 "http://127.0.0.1/geode/health") echo "response ${response}" if [ "$response" != "200" ]; then - delete_service + if delete_service; then + stop_instance + fi break fi done diff --git a/ruff.toml b/ruff.toml index 46d218b..21f48b4 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,6 +1,6 @@ # https://docs.astral.sh/ruff/configuration/ -target-version = "py312" +target-version = "py314" line-length = 100 indent-width = 4 extend-exclude = ["**/schemas/**"] # generated schemas