mirror of https://github.com/docker/cli.git
Merge pull request #127 from andrewhsu/gitcommit
allow override of git hash when building binary
This commit is contained in:
commit
11e7d35f9c
|
@ -9,6 +9,7 @@ LINTER_IMAGE_NAME = docker-cli-lint
|
||||||
CROSS_IMAGE_NAME = docker-cli-cross
|
CROSS_IMAGE_NAME = docker-cli-cross
|
||||||
MOUNTS = -v `pwd`:/go/src/github.com/docker/cli
|
MOUNTS = -v `pwd`:/go/src/github.com/docker/cli
|
||||||
VERSION = $(shell cat VERSION)
|
VERSION = $(shell cat VERSION)
|
||||||
|
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT
|
||||||
|
|
||||||
# build docker image (dockerfiles/Dockerfile.build)
|
# build docker image (dockerfiles/Dockerfile.build)
|
||||||
.PHONY: build_docker_image
|
.PHONY: build_docker_image
|
||||||
|
@ -27,7 +28,7 @@ build_cross_image:
|
||||||
|
|
||||||
# build executable using a container
|
# build executable using a container
|
||||||
binary: build_docker_image
|
binary: build_docker_image
|
||||||
docker run --rm -e VERSION=$(VERSION) $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make binary
|
docker run --rm $(ENVVARS) $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make binary
|
||||||
|
|
||||||
build: binary
|
build: binary
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ test: build_docker_image
|
||||||
# build the CLI for multiple architectures using a container
|
# build the CLI for multiple architectures using a container
|
||||||
.PHONY: cross
|
.PHONY: cross
|
||||||
cross: build_cross_image
|
cross: build_cross_image
|
||||||
docker run --rm -e VERSION=$(VERSION) $(MOUNTS) $(CROSS_IMAGE_NAME) make cross
|
docker run --rm $(ENVVARS) $(MOUNTS) $(CROSS_IMAGE_NAME) make cross
|
||||||
|
|
||||||
.PHONY: watch
|
.PHONY: watch
|
||||||
watch: build_docker_image
|
watch: build_docker_image
|
||||||
|
@ -68,4 +69,4 @@ vendor: build_docker_image vendor.conf
|
||||||
docker run -ti --rm $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make vendor
|
docker run -ti --rm $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make vendor
|
||||||
|
|
||||||
dynbinary: build_cross_image
|
dynbinary: build_cross_image
|
||||||
docker run -ti --rm $(MOUNTS) $(CROSS_IMAGE_NAME) make dynbinary
|
docker run --rm $(ENVVARS) $(MOUNTS) $(CROSS_IMAGE_NAME) make dynbinary
|
||||||
|
|
Loading…
Reference in New Issue