Browse Source

[Fix][Docker] Fix docker image build error (#5613)

2.0.7-release
Shiwen Cheng 4 years ago committed by GitHub
parent
commit
0d303a804d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docker/build/hooks/build
  2. 2
      docker/build/hooks/build.bat

2
docker/build/hooks/build

@ -24,7 +24,7 @@ printenv
if [ -z "${VERSION}" ] if [ -z "${VERSION}" ]
then then
echo "set default environment variable [VERSION]" echo "set default environment variable [VERSION]"
export VERSION=$(cat $(pwd)/pom.xml | grep '<revision>' -m 1 | awk '{print $1}' | sed 's/<revision>//' | sed 's/<\/revision>//') export VERSION=$(cat $(pwd)/pom.xml | grep '<version>' -m 1 | awk '{print $1}' | sed 's/<version>//' | sed 's/<\/version>//')
fi fi
if [ "${DOCKER_REPO}x" = "x" ] if [ "${DOCKER_REPO}x" = "x" ]

2
docker/build/hooks/build.bat

@ -22,7 +22,7 @@ setlocal enableextensions enabledelayedexpansion
if not defined VERSION ( if not defined VERSION (
echo "set environment variable [VERSION]" echo "set environment variable [VERSION]"
set first=1 set first=1
for /f "tokens=3 delims=<>" %%a in ('findstr "<revision>[0-9].*</revision>" %cd%\pom.xml') do ( for /f "tokens=3 delims=<>" %%a in ('findstr "<version>[0-9].*</version>" %cd%\pom.xml') do (
if !first! EQU 1 (set VERSION=%%a) if !first! EQU 1 (set VERSION=%%a)
set first=0 set first=0
) )

Loading…
Cancel
Save