From 32fca7206c5be054f252dd5cdc892ebf9873c576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 6 Apr 2018 10:23:56 +0200 Subject: [PATCH] Make latest tag detection work without DockerHub API --- hack/bootstrap_tfw_dev.sh | 9 ++++++--- hack/oneline_install.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hack/bootstrap_tfw_dev.sh b/hack/bootstrap_tfw_dev.sh index 3a0d2ed..ebe362f 100755 --- a/hack/bootstrap_tfw_dev.sh +++ b/hack/bootstrap_tfw_dev.sh @@ -30,9 +30,12 @@ echo "Done!" if [ -z "$TFWDEV" ]; then echo -n "Pinning latest TFW baseimage version... " - TFWURL=https://registry.hub.docker.com/v1/repositories/avatao/tutorial-framework/tags - PYTHON_PARSEJSON="import sys, json; print json.load(sys.stdin)[-1]['name']" - LATESTTAG="$(curl -fsSL ${TFWURL} | python -c "${PYTHON_PARSEJSON}")" + LATESTTAG="$(git ls-remote --tags git@github.com:avatao-content/baseimage-tutorial-framework.git | + cut -f2 | + grep -oP '(?<=refs/tags/)\w+-\d{8}$' | + sort -t '-' -k2 | + tail -n 1)" + echo -n "which is ${LATESTTAG}... " sed -i "1 s/.*/&:${LATESTTAG}/" "${TEST}/solvable/Dockerfile" echo "Done!" diff --git a/hack/oneline_install.sh b/hack/oneline_install.sh index 337d207..75d3cc7 100644 --- a/hack/oneline_install.sh +++ b/hack/oneline_install.sh @@ -1 +1 @@ -URL=https://git.io/vxBfj SHA=28cddbadc12416fd160590340010189368711612f5ddb9d18ad933ae0199da53 bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!' +URL=https://git.io/vxBfj SHA=a782b61bb9bbc28aaae174a0ed31aec35108a11068bc3f91ff33f43e29585ea7 bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!'