Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
312 changed files
with
7,123 additions
and
2,447 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,7 @@ | |
*.png binary | ||
*.jpg binary | ||
*.pdf binary | ||
|
||
# files with LF | ||
*.twig text eol=lf | ||
TestCase_*.txt eol=lf |
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 |
---|---|---|
|
@@ -16,3 +16,4 @@ key3.db | |
.gearman-cache | ||
.sakuli-steps-cache | ||
Dockerfile.local | ||
**/test-output/ |
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,99 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e -o pipefail | ||
|
||
IMAGES=( | ||
"consol/sakuli-ubuntu-xfce" | ||
"consol/sakuli-ubuntu-xfce-java" | ||
"consol/sakuli-ubuntu-icewm" | ||
"consol/sakuli-ubuntu-icewm-java" | ||
"consol/sakuli-centos-xfce" | ||
"consol/sakuli-centos-xfce-java" | ||
"consol/sakuli-centos-icewm" | ||
"consol/sakuli-centos-icewm-java" | ||
"consol/sakuli-ui" | ||
"consol/omd-labs-ubuntu-sakuli" | ||
"consol/omd-labs-centos-sakuli" | ||
"consol/omd-labs-debian-sakuli" | ||
) | ||
PATTERN="SNAPSHOT" | ||
#PATTERN="v1.1.0-SNAPSHOT" | ||
|
||
logfile="docker.delete.images.log" | ||
SAVEMODE=$1 | ||
|
||
echo "" > $logfile | ||
token="" | ||
function loginToDocker() { | ||
if [[ $HUB_USERNAME == "" ]] || [[ $HUB_PASSWORD == "" ]] ; then | ||
echo "please set dockerhub login credentials via env vars: 'HUB_USERNAME' and 'HUB_PASSWORD'" | ||
exit -1 | ||
fi | ||
json=$(curl -s --fail -i -X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Accept: application/json" \ | ||
-d '{"username":"'${HUB_USERNAME}'","password":"'${HUB_PASSWORD}'"}' \ | ||
https://hub.docker.com/v2/users/login/ | grep "{" ) | ||
# echo $json | ||
# echo "--------------------" | ||
token=$(echo $json | jq --raw-output '.token' ) | ||
|
||
echo TOKEN: $token | ||
echo "logged in user: $HUB_USERNAME" | ||
echo "--------------------" | ||
} | ||
|
||
function deleteTags () { | ||
if [[ $1 == "" ]] ; then | ||
echo "use function: deleteTag <user/repo>" | ||
exit -1 | ||
fi | ||
|
||
echo "getTags: ${1}" | ||
json=$(curl --fail -i -X GET \ | ||
https://hub.docker.com/v2/repositories/${1}/tags/ | grep "{") | ||
# echo "$json" | ||
# echo "-------------------------" | ||
|
||
### ensure continue if no tags are matching | ||
set +e +o pipefail | ||
tags=$( echo "$json" | jq --raw-output '.results[].name' | grep $PATTERN ) | ||
set -e -o pipefail | ||
|
||
echo "-------------------------" | ||
echo "TAGS:" | ||
echo "$tags" | ||
echo "-------------------------" | ||
|
||
if [[ $tags == "" ]] ; then echo "no tags" && return ; fi | ||
|
||
for tag in $tags ; do | ||
echo "delete ${1}:${tag}" | ||
echo "${1}:${tag}" >> $logfile | ||
|
||
if [[ "$SAVEMODE" != "--save" ]] ; then | ||
curl --fail -i -X DELETE \ | ||
-H "Accept: application/json" \ | ||
-H "Authorization: JWT $token" \ | ||
"https://hub.docker.com/v2/repositories/${1}/tags/${tag}/" | ||
fi | ||
echo "........................." | ||
done | ||
} | ||
|
||
function logout() { | ||
echo "logout user: $HUB_USERNAME" | ||
curl -s -i --fail -X POST \ | ||
-H "Accept: application/json" \ | ||
-H "Authorization: JWT $token" \ | ||
https://hub.docker.com/v2/logout/ | ||
} | ||
|
||
loginToDocker | ||
#deleteTags "consol/sakuli-ubuntu-xfce" | ||
#Loop | ||
for IMAGE in "${IMAGES[@]}" ; do | ||
deleteTags $IMAGE | ||
done | ||
logout | ||
echo "-----------> DONE!" |
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
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.