fn: dind image version fixes (#769)

1) use dind docker version instead of installed local docker
2) do not skip pre-release semver handling, eg. 17.12.0-ce
This commit is contained in:
Tolga Ceylan
2018-02-13 18:39:37 -08:00
committed by GitHub
parent 1a1250e5ea
commit 75f48fb520
2 changed files with 14 additions and 7 deletions

View File

@@ -1,12 +1,16 @@
set -ex
#!/bin/bash
set -exo pipefail
docker build --build-arg HTTPS_PROXY --build-arg HTTP_PROXY -t fnproject/dind:latest .
# Match version with Docker version
version=$(docker run --rm -v "$PWD":/app treeder/bump --extract --input "`docker -v`")
docker_info=$(docker run --rm fnproject/dind:latest docker -v 2>/dev/null | grep "^Docker version")
version=$(echo $docker_info | cut -d ' ' -f 3 | tr -d ,)
echo "Version: $version"
M=$(docker run --rm treeder/bump --format M --input "$version")
Mm=$(docker run --rm treeder/bump --format M.m --input "$version")
M=$(echo $version | cut -d '.' -f 1)
Mm=$(echo $version | cut -d '.' -f 1,2)
# Tag these up so that they're available for the local build process,
# if necessary

View File

@@ -16,10 +16,13 @@ fi
# after any related tests have passed.
# Match version with Docker version
version=$(docker run --rm -v "$PWD":/app treeder/bump --extract --input "`docker -v`")
docker_info=$(docker run --rm fnproject/dind:latest docker -v 2>/dev/null | grep "^Docker version")
version=$(echo $docker_info | cut -d ' ' -f 3 | tr -d ,)
echo "Version: $version"
M=$(docker run --rm treeder/bump --format M --input "$version")
Mm=$(docker run --rm treeder/bump --format M.m --input "$version")
M=$(echo $version | cut -d '.' -f 1)
Mm=$(echo $version | cut -d '.' -f 1,2)
# Calculate new release version
DIND_NEW=$(echo "$DIND_PREV" | perl -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e')