mirror of
https://github.com/luzifer-docker/jenkins.git
synced 2024-12-29 23:51:15 +00:00
Adjust version check to use latestver
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e28c6d6951
commit
2d606b320a
1 changed files with 5 additions and 23 deletions
|
@ -13,32 +13,14 @@ git reset --hard origin/master
|
||||||
|
|
||||||
### ---- ###
|
### ---- ###
|
||||||
|
|
||||||
if ! [ -e jq ]; then
|
|
||||||
echo "Loading local copy of jq-1.5"
|
|
||||||
|
|
||||||
case ${HOST_OS} in
|
|
||||||
Linux)
|
|
||||||
curl -sSLfo ./jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
|
|
||||||
;;
|
|
||||||
Darwin)
|
|
||||||
curl -sSLfo ./jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "/!\\ Unable to download jq for ${HOST_OS}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
chmod +x jq
|
|
||||||
fi
|
|
||||||
|
|
||||||
### ---- ###
|
|
||||||
|
|
||||||
echo "Fetching latest version..."
|
echo "Fetching latest version..."
|
||||||
LATEST=$(curl -sSLf https://index.docker.io/v1/repositories/jenkins/tags | ./jq -r '.[].name' | grep "^[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?$" | sort -Vr | head -n1)
|
LATEST=$(curl -sSLf 'https://latest.luzifer.io/catalog-api/jenkins/lts.txt?p=version')
|
||||||
|
|
||||||
|
echo "Testing pull for jenkins/jenkins:${LATEST}..."
|
||||||
|
docker pull jenkins/jenkins:${LATEST}
|
||||||
|
|
||||||
echo "Found version ${LATEST}, patching..."
|
echo "Found version ${LATEST}, patching..."
|
||||||
sed -i "s/^FROM.*$/FROM jenkins:${LATEST}/" Dockerfile
|
sed -i "s/^FROM.*$/FROM jenkins\/jenkins:${LATEST}/" Dockerfile
|
||||||
|
|
||||||
echo "Checking for changes..."
|
echo "Checking for changes..."
|
||||||
git diff --exit-code && exit 0
|
git diff --exit-code && exit 0
|
||||||
|
|
Loading…
Reference in a new issue