Skip to content

Commit

Permalink
Add script to unregister GA runners
Browse files Browse the repository at this point in the history
  • Loading branch information
jrusz authored and achilleas-k committed Nov 9, 2023
1 parent 23bb887 commit c5264cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ stages:
- cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null
after_script:
- schutzbot/ci_details.sh > ci-details-after-run || true
- schutzbot/unregister.sh || true
- schutzbot/update_github_status.sh update || true
interruptible: true
tags:
Expand Down
22 changes: 22 additions & 0 deletions schutzbot/unregister.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Colorful output.
function greenprint {
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m"
}
function redprint {
echo -e "\033[1;31m[$(date -Isecond)] ${1}\033[0m"
}

if ! hash subscription-manager; then
exit 0
fi
if ! sudo subscription-manager status; then
exit 0
fi
if sudo subscription-manager unregister; then
greenprint "Host unregistered."
exit 0
fi
redprint "Failed to unregister"
exit 1

0 comments on commit c5264cd

Please sign in to comment.