2019-01-18 14:09:23 +00:00
|
|
|
__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
|
|
|
|
|
2018-11-06 21:29:16 +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-11-06 21:29:16 +00:00
|
|
|
|
2019-01-23 10:11:31 +00:00
|
|
|
# WARNING: Remember to update `ci/Jenkinsfile.*` with the same IMAGE_TAG value
|
2019-01-31 23:17:55 +00:00
|
|
|
BASE_IMAGE_TAG = $(shell cd $(GIT_ROOT)/docker/base && make get-image-tag)
|
2019-02-26 20:58:15 +00:00
|
|
|
DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) -d cmake -d conan -d golang -d node -d react_native_desktop -d windows_base_image)
|
|
|
|
IMAGE_TAG = 1.1.1-$(DEPS_HASH)
|
2019-01-18 00:31:07 +00:00
|
|
|
IMAGE_NAME = statusteam/status-build-windows:$(IMAGE_TAG)
|
2019-01-09 13:59:39 +00:00
|
|
|
|
2019-02-26 20:58:15 +00:00
|
|
|
WIN_BASE_IMAGE_VER = $(call __toolversion, windows_base_image)
|
|
|
|
WIN_BASE_IMAGE_DM5 = $(call __toolversion, -c windows_base_image)
|
|
|
|
WIN_BASE_IMAGE_ZIP = StatusIm-Windows-base-image_$(WIN_BASE_IMAGE_VER).zip
|
|
|
|
WIN_BASE_IMAGE_URL = https://desktop-app-files.ams3.digitaloceanspaces.com/$(WIN_BASE_IMAGE_ZIP)
|
|
|
|
|
|
|
|
build: $(WIN_BASE_IMAGE_ZIP)
|
2019-01-23 10:11:31 +00:00
|
|
|
@ if [ "${DEPS_HASH}" = "" ]; then \
|
|
|
|
echo "DEPS_HASH not set"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2018-11-06 21:29:16 +00:00
|
|
|
docker build \
|
2019-01-23 10:11:31 +00:00
|
|
|
--build-arg="BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)" \
|
2019-01-18 00:31:07 +00:00
|
|
|
--build-arg="CONAN_VERSION=$(call __toolversion, conan)" \
|
|
|
|
--build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \
|
2019-01-31 23:17:55 +00:00
|
|
|
--build-arg="GOLANG_VERSION=$(call __toolversion, golang)" \
|
|
|
|
--build-arg="NODE_VERSION=$(call __toolversion, node)" \
|
|
|
|
--build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \
|
2019-02-26 20:58:15 +00:00
|
|
|
--build-arg="WIN_BASE_IMAGE_VERSION=$(WIN_BASE_IMAGE_VER)" \
|
2018-11-06 21:29:16 +00:00
|
|
|
--label="commit=$(GIT_COMMIT)" \
|
2019-01-23 10:11:31 +00:00
|
|
|
-t $(IMAGE_NAME) .
|
2018-11-06 21:29:16 +00:00
|
|
|
|
2019-02-26 20:58:15 +00:00
|
|
|
$(WIN_BASE_IMAGE_ZIP):
|
|
|
|
wget -q "$(WIN_BASE_IMAGE_URL)" -O "$(WIN_BASE_IMAGE_ZIP)"
|
|
|
|
echo "$(WIN_BASE_IMAGE_DM5) $(WIN_BASE_IMAGE_ZIP)" | md5sum --check
|
|
|
|
|
2018-11-06 21:29:16 +00:00
|
|
|
push: build
|
|
|
|
docker push $(IMAGE_NAME)
|