2019-01-18 14:09:23 +00:00
|
|
|
__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1))
|
2019-02-01 09:52:19 +00:00
|
|
|
__major_version = $(shell echo $(1) | cut -d. -f1,2)
|
2019-01-18 14:09:23 +00:00
|
|
|
|
2018-09-05 18:17:25 +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-09-05 18:17:25 +00:00
|
|
|
|
2019-01-18 00:31:07 +00:00
|
|
|
QT_VERSION = $(call __toolversion, qt)
|
2019-01-31 23:17:55 +00:00
|
|
|
QT_MD5SUM = $(call __toolversion, -c qt)
|
2018-09-28 16:29:13 +00:00
|
|
|
QT_ARCHIVE = qt-opensource-linux-x64-$(QT_VERSION).run
|
|
|
|
QT_URL = https://download.qt.io/archive/qt
|
|
|
|
|
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)
|
|
|
|
DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) -d cmake -d golang -d node -d qt -d qtci -d react_native_desktop)
|
2019-02-26 20:58:15 +00:00
|
|
|
IMAGE_TAG = 1.1.1-$(DEPS_HASH)
|
2019-01-18 00:31:07 +00:00
|
|
|
IMAGE_NAME = statusteam/status-build-linux:$(IMAGE_TAG)
|
2018-09-05 18:17:25 +00:00
|
|
|
|
|
|
|
build: $(QT_ARCHIVE)
|
2019-01-23 10:11:31 +00:00
|
|
|
@ if [ "${DEPS_HASH}" = "" ]; then \
|
|
|
|
echo "DEPS_HASH not set"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2018-09-05 18:17:25 +00:00
|
|
|
docker build \
|
2019-01-23 10:11:31 +00:00
|
|
|
--build-arg="BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)" \
|
2019-01-31 23:17:55 +00:00
|
|
|
--build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \
|
|
|
|
--build-arg="GOLANG_VERSION=$(call __toolversion, golang)" \
|
2019-01-23 10:11:31 +00:00
|
|
|
--build-arg="NODE_VERSION=$(call __toolversion, node)" \
|
2018-09-28 16:29:13 +00:00
|
|
|
--build-arg="QT_VERSION=$(QT_VERSION)" \
|
2019-01-18 00:31:07 +00:00
|
|
|
--build-arg="QT_CI_COMMIT=$(call __toolversion, qtci)" \
|
|
|
|
--build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \
|
2018-09-28 16:29:13 +00:00
|
|
|
--label="commit=$(GIT_COMMIT)" \
|
2019-01-23 10:11:31 +00:00
|
|
|
-t $(IMAGE_NAME) .
|
2018-09-05 18:17:25 +00:00
|
|
|
|
|
|
|
$(QT_ARCHIVE):
|
2019-02-01 09:52:19 +00:00
|
|
|
wget $(QT_URL)/$(call __major_version, $(QT_VERSION))/$(QT_VERSION)/$(QT_ARCHIVE)
|
2018-09-05 18:17:25 +00:00
|
|
|
echo "$(QT_MD5SUM) $(QT_ARCHIVE)" | md5sum --check
|
|
|
|
|
|
|
|
push: build
|
|
|
|
docker push $(IMAGE_NAME)
|