-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Hotfix 221124001 - Added automation to push alpha and beta containers - Added script to clean alpha and beta containers from the hub - Added an extra field to the orchestrator vm with the host url - Added the ability to query the orchestrator with no cache involved - Moved the reverse proxy to use queues for start/stop/restart operations - Fixed some error messages with missing parameters * fix the testing issues
- Loading branch information
Showing
33 changed files
with
475 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
MODE="UNKNOWN" | ||
PATTERN="" | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
rm) | ||
MODE="REMOVE" | ||
shift | ||
;; | ||
ls) | ||
MODE="LIST" | ||
shift | ||
;; | ||
--pattern) | ||
PATTERN=$2 | ||
shift | ||
shift | ||
;; | ||
--filter) | ||
PATTERN=$2 | ||
shift | ||
shift | ||
;; | ||
*) | ||
echo "Invalid argument: $1" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [ "$MODE" == "UNKNOWN" ]; then | ||
echo "You need to specify the mode (rm, ls) with the first argument" | ||
exit 1 | ||
fi | ||
|
||
if [ "$PATTERN" == "" ]; then | ||
PATTERN=".*" | ||
fi | ||
|
||
function list() { | ||
OUT=$(hub-tool tag ls cjlapao/prl-devops-service --format json) | ||
LINES=$(echo "$OUT" | jq -r '.[].Name') | ||
echo "$LINES" | while IFS= read -r line; do | ||
if [[ $line =~ $PATTERN ]]; then | ||
echo "$line" | ||
fi | ||
done | ||
} | ||
|
||
function remove() { | ||
echo "WARNING: You are about to permanently delete images that match the pattern: $PATTERN" | ||
echo " This action is irreversible" | ||
read -r -p "Are you sure you want to continue? (yes/no): " confirm | ||
if [ "$confirm" != "yes" ]; then | ||
echo "Operation aborted." | ||
exit 1 | ||
fi | ||
|
||
lines=$(list) | ||
echo "$lines" | while IFS= read -r line; do | ||
echo "Deleting image $line" | ||
hub-tool tag rm "$line" -f | ||
done | ||
} | ||
|
||
if [ "$MODE" == "LIST" ]; then | ||
list | ||
elif [ "$MODE" == "REMOVE" ]; then | ||
remove "$PATTERN" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.