Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Update Docker tag checking
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Nov 29, 2023
1 parent 6f0d39c commit 17a026b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions rebuild-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ git stash 1>&2
git pull --rebase 1>&2
popd 1>&2

function docker_tag_exists() {
. /srv/repository/docker-credentials
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${UNAME}'", "password": "'${UPASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null
}

# Docker Metaimage function
do_docker_meta() {
pushd ${metapackages_dir} 1>&2
Expand All @@ -76,9 +82,13 @@ do_docker_meta() {
server_ok=""
web_ok=""
for arch in ${docker_arches[@]}; do
curl --silent -f -lSL https://index.docker.io/v1/repositories/jellyfin/jellyfin-server/tags/${version}-${arch} >/dev/null && server_ok="${server_ok}y"
if docker_tag_exists jellyfin/jellyfin-server ${version}-${arch}; then
server_ok="${server_ok}y"
fi
done
curl --silent -f -lSL https://index.docker.io/v1/repositories/jellyfin/jellyfin-web/tags/${version} >/dev/null && web_ok="y"
if docker_tag_exists jellyfin/jellyfin-web ${version}; then
web_ok="y"
fi
if [[ ${server_ok} != "yyy" || ${web_ok} != "y" ]]; then
return
fi
Expand Down

0 comments on commit 17a026b

Please sign in to comment.