2019-01-18 00:31:07 +00:00
|
|
|
__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
|
|
|
|
|
2018-12-09 14:58:03 +00:00
|
|
|
GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
2019-01-21 15:29:33 +00:00
|
|
|
GIT_ROOT = $(shell git rev-parse --show-toplevel)
|
2018-12-09 14:58:03 +00:00
|
|
|
|
|
|
|
# WARNING: Remember to change the tag when updating the image
|
2019-01-23 10:11:31 +00:00
|
|
|
DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -d leiningen -d node -d yarn)
|
|
|
|
IMAGE_TAG = 1.1.0-$(DEPS_HASH)
|
2018-12-09 14:58:03 +00:00
|
|
|
IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG)
|
|
|
|
|
2019-01-23 10:11:31 +00:00
|
|
|
get-image-tag:
|
2019-01-31 23:17:55 +00:00
|
|
|
@echo $(IMAGE_TAG)
|
2019-01-23 10:11:31 +00:00
|
|
|
|
2019-01-18 00:31:07 +00:00
|
|
|
build: nvm_install.sh
|
2018-12-09 14:58:03 +00:00
|
|
|
docker build \
|
2019-01-18 00:31:07 +00:00
|
|
|
--build-arg="LEIN_VERSION=$(call __toolversion, leiningen)" \
|
|
|
|
--build-arg="NODE_VERSION=$(call __toolversion, node)" \
|
|
|
|
--build-arg="YARN_VERSION=$(call __toolversion, yarn)" \
|
2018-12-09 14:58:03 +00:00
|
|
|
--label="commit=$(GIT_COMMIT)" \
|
|
|
|
-t $(IMAGE_NAME) .
|
|
|
|
|
2019-01-18 00:31:07 +00:00
|
|
|
nvm_install.sh:
|
|
|
|
cp $(GIT_ROOT)/scripts/3rd-party/nvm/$(call __toolversion, nvm)/install.sh nvm_install.sh
|
|
|
|
|
2018-12-09 14:58:03 +00:00
|
|
|
push: build
|
|
|
|
docker push $(IMAGE_NAME)
|