Преглед изворни кода

Allows VERSION to be overwritten by env variable

VERSION was hardcoded to be used as the `VERSION` file from the root
directory, this makes it so that you have the option to overwrite this.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Eli Uriegas пре 8 година
родитељ
комит
7664302579
2 измењених фајлова са 3 додато и 2 уклоњено
  1. 2 1
      Makefile
  2. 1 1
      hack/make.sh

+ 2 - 1
Makefile

@@ -43,7 +43,8 @@ DOCKER_ENVS := \
 	-e NO_PROXY \
 	-e NO_PROXY \
 	-e http_proxy \
 	-e http_proxy \
 	-e https_proxy \
 	-e https_proxy \
-	-e no_proxy
+	-e no_proxy \
+	-e VERSION
 # note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
 # note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
 
 
 # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`
 # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`

+ 1 - 1
hack/make.sh

@@ -67,7 +67,7 @@ DEFAULT_BUNDLES=(
 	tgz
 	tgz
 )
 )
 
 
-VERSION=$(< ./VERSION)
+VERSION=${VERSION:-$(< ./VERSION)}
 ! BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
 ! BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
 if [ "$DOCKER_GITCOMMIT" ]; then
 if [ "$DOCKER_GITCOMMIT" ]; then
 	GITCOMMIT="$DOCKER_GITCOMMIT"
 	GITCOMMIT="$DOCKER_GITCOMMIT"