From 6d3211de46f302ab1a92eb3bb711733dd9cb8d9f Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Fri, 1 Feb 2019 00:17:55 +0100 Subject: [PATCH] Add golang to `.TOOLVERSIONS` and fix md5 calculation Signed-off-by: Pedro Pombeiro --- .TOOLVERSIONS | 1 + ci/Jenkinsfile.linux | 2 +- ci/Jenkinsfile.windows | 2 +- docker/android/Dockerfile | 4 ++-- docker/android/Makefile | 15 ++++++++++----- docker/base/Makefile | 2 +- docker/linux/Dockerfile | 27 ++++++++++++++++----------- docker/linux/Makefile | 9 +++++---- docker/windows/Dockerfile | 21 ++++++++++++++------- docker/windows/Makefile | 8 +++++--- 10 files changed, 56 insertions(+), 35 deletions(-) diff --git a/.TOOLVERSIONS b/.TOOLVERSIONS index d1df48d0a0..e66b7ef186 100644 --- a/.TOOLVERSIONS +++ b/.TOOLVERSIONS @@ -5,6 +5,7 @@ android-sdk;4333796;aa190cfd7299cd6a1c687355bb2764e4 clojure_cli;1.9.0.381; cmake;3.12.2; conan;1.9.0; +golang;1.10.2; leiningen;2.8.1; maven;3.5.2; node;10.12.0; diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index a438b20d94..98ba5bef1f 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -4,7 +4,7 @@ pipeline { docker { label 'linux-new' /* WARNING: remember to keep this up-to-date with the value in docker/linux/Makefile */ - image 'statusteam/status-build-linux:1.1.0-f653fffb' + image 'statusteam/status-build-linux:1.1.0-2a35dcde' args ( "--privileged "+ "-v /dev/fuse:/dev/fuse "+ diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index f3793da88a..490da64218 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -4,7 +4,7 @@ pipeline { docker { label 'linux-new' /* WARNING: remember to keep this up-to-date with the value in docker/windows/Makefile */ - image 'statusteam/status-build-windows:1.1.0-c37b3fa2' + image 'statusteam/status-build-windows:1.1.0-fb116054' args ( "--privileged "+ "-v /dev/fuse:/dev/fuse "+ diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile index 49765e9c2a..be01b9ab47 100644 --- a/docker/android/Dockerfile +++ b/docker/android/Dockerfile @@ -1,7 +1,7 @@ # This image is only for extracting and cleaning up NDK and SDK ARG BASE_IMAGE_TAG -FROM statusteam/status-build-base:1.1.0-${BASE_IMAGE_TAG} AS sdk_and_ndk +FROM statusteam/status-build-base:${BASE_IMAGE_TAG} AS sdk_and_ndk ARG ANDROID_NDK_VERSION ARG ANDROID_SDK_VERSION @@ -40,7 +40,7 @@ RUN cd /usr/lib/android-ndk && rm -fr docs tests samples \ && find sources -mindepth 2 -maxdepth 2 | grep -v 'gnu-libstdc' | xargs rm -fr ################################################################################ -FROM statusteam/status-build-base:1.1.0-${BASE_IMAGE_TAG} +FROM statusteam/status-build-base:${BASE_IMAGE_TAG} ARG ANDROID_NDK_VERSION ARG ANDROID_SDK_VERSION diff --git a/docker/android/Makefile b/docker/android/Makefile index f193586761..ebe1acb075 100644 --- a/docker/android/Makefile +++ b/docker/android/Makefile @@ -4,12 +4,12 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) ANDROID_NDK_VERSION = $(call __toolversion, android-ndk) -ANDROID_NDK_CHECKSUM = $(call __toolversion, android-ndk_md5) +ANDROID_NDK_CHECKSUM = $(call __toolversion, -c android-ndk) ANDROID_NDK_ARCHIVE = android-ndk-$(ANDROID_NDK_VERSION)-linux-x86_64.zip ANDROID_NDK_URL = https://dl.google.com/android/repository/$(ANDROID_NDK_ARCHIVE) ANDROID_SDK_VERSION = $(call __toolversion, android-sdk) -ANDROID_SDK_CHECKSUM = $(call __toolversion, android-sdk_md5) +ANDROID_SDK_CHECKSUM = $(call __toolversion, -c android-sdk) ANDROID_SDK_URL = https://dl.google.com/android/repository/sdk-tools-linux-$(ANDROID_SDK_VERSION).zip ANDROID_SDK_ARCHIVE = sdk-tools-linux-$(ANDROID_SDK_VERSION).zip @@ -17,17 +17,22 @@ SDK_PLATFORM_VERSION=$(call __toolversion, android-sdk-platform) SDK_BUILD_TOOLS_VERSION=$(call __toolversion, android-sdk-build-tools) # WARNING: Remember to change the tag when updating the image -BASE_IMAGE_TAG = $(shell cd ../base && make get-image-tag) -DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) -d android-ndk -d android-sdk -d android-sdk-platform -d android-sdk-build-tools) +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 android-ndk \ + -d android-sdk \ + -d android-sdk-platform \ + -d android-sdk-build-tools) IMAGE_TAG = 1.1.0-$(DEPS_HASH) IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG) build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE) docker build \ + --build-arg="BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)" \ --build-arg="ANDROID_NDK_VERSION=$(ANDROID_NDK_VERSION)" \ --build-arg="ANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)" \ - --build-arg="SDK_PLATFORM_VERSION=$(SDK_PLATFORM_VERSION)" \ --build-arg="SDK_BUILD_TOOLS_VERSION=$(SDK_BUILD_TOOLS_VERSION)" \ + --build-arg="SDK_PLATFORM_VERSION=$(SDK_PLATFORM_VERSION)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) . diff --git a/docker/base/Makefile b/docker/base/Makefile index a374817154..5470429cc4 100644 --- a/docker/base/Makefile +++ b/docker/base/Makefile @@ -9,7 +9,7 @@ IMAGE_TAG = 1.1.0-$(DEPS_HASH) IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG) get-image-tag: - @echo $(DEPS_HASH) + @echo $(IMAGE_TAG) build: nvm_install.sh docker build \ diff --git a/docker/linux/Dockerfile b/docker/linux/Dockerfile index 267cc231be..1b7409433e 100644 --- a/docker/linux/Dockerfile +++ b/docker/linux/Dockerfile @@ -1,10 +1,10 @@ ARG BASE_IMAGE_TAG -FROM statusteam/status-build-base:1.1.0-${BASE_IMAGE_TAG} AS qt_build +FROM statusteam/status-build-base:${BASE_IMAGE_TAG} AS qt_build ARG QT_VERSION -ARG RNATIVE_VERSION ARG QT_CI_COMMIT +ARG RNATIVE_VERSION ENV XDG_RUNTIME_DIR=/tmp/runtime-root @@ -38,7 +38,7 @@ RUN mkdir -p /tmp/qtci \ '.*\/(qdoc|qgltf|linguist|designer|assistant|qhelpconverter|qmlprofiler)$' -delete \ && rm -fr ${XDG_RUNTIME_DIR} -FROM statusteam/status-build-base:1.1.0-${BASE_IMAGE_TAG} +FROM statusteam/status-build-base:${BASE_IMAGE_TAG} ARG QT_VERSION ARG CMAKE_VERSION @@ -50,19 +50,18 @@ RUN ln -s /opt/qt/mkspecs /usr/local/mkspecs \ # We have to do this because Jenkins doesn't let us # https://issues.jenkins-ci.org/browse/JENKINS-49076 ARG NODE_VERSION -ENV PATH=/opt/qt/bin:/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH=/opt/qt/bin:/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN apt-get update \ && add-apt-repository -y ppa:git-core/ppa \ - && add-apt-repository -y ppa:longsleep/golang-backports \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get -q -y --no-install-recommends install \ - golang-go python python3-pip python3-setuptools python3-wheel \ - apt-transport-https openjdk-8-jdk-headless \ - extra-cmake-modules build-essential gcc g++ fuse \ - libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ - libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \ + python python3-pip python3-setuptools python3-wheel \ + apt-transport-https openjdk-8-jdk-headless \ + extra-cmake-modules build-essential gcc g++ fuse \ + libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ + libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man @@ -72,6 +71,12 @@ RUN cd /tmp \ && rm -fr /usr/local/doc/cmake \ && rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz +ARG GOLANG_VERSION +RUN cd /tmp \ + && wget -q https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz \ + && rm go${GOLANG_VERSION}.linux-amd64.tar.gz + RUN mkdir -p /tmp/react-native-desktop \ && cd /tmp/react-native-desktop \ && git init \ @@ -85,6 +90,6 @@ RUN mkdir -p /tmp/react-native-desktop \ && cd \ && rm -r /tmp/react-native-desktop -LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/docker" \ +LABEL source="https://github.com/status-im/status-react/tree/develop/docker/linux" \ description="Image for building Linux Desktop version of Status app." \ maintainer="jakub@status.im" diff --git a/docker/linux/Makefile b/docker/linux/Makefile index 04d69990c8..54d6ce93d9 100644 --- a/docker/linux/Makefile +++ b/docker/linux/Makefile @@ -5,13 +5,13 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) QT_VERSION = $(call __toolversion, qt) -QT_MD5SUM = $(call __toolversion, qt_md5) +QT_MD5SUM = $(call __toolversion, -c qt) QT_ARCHIVE = qt-opensource-linux-x64-$(QT_VERSION).run QT_URL = https://download.qt.io/archive/qt # WARNING: Remember to update `ci/Jenkinsfile.*` with the same IMAGE_TAG value -BASE_IMAGE_TAG = $(shell cd ../base && make get-image-tag) -DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) -d cmake -d node -d qt -d qtci -d react_native_desktop) +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) IMAGE_TAG = 1.1.0-$(DEPS_HASH) IMAGE_NAME = statusteam/status-build-linux:$(IMAGE_TAG) @@ -22,11 +22,12 @@ build: $(QT_ARCHIVE) fi docker build \ --build-arg="BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)" \ + --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \ + --build-arg="GOLANG_VERSION=$(call __toolversion, golang)" \ --build-arg="NODE_VERSION=$(call __toolversion, node)" \ --build-arg="QT_VERSION=$(QT_VERSION)" \ --build-arg="QT_CI_COMMIT=$(call __toolversion, qtci)" \ --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \ - --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) . diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile index d9d08a13ad..3a1d18a2a9 100644 --- a/docker/windows/Dockerfile +++ b/docker/windows/Dockerfile @@ -1,20 +1,22 @@ ARG BASE_IMAGE_TAG -FROM statusteam/status-build-base:1.1.0-${BASE_IMAGE_TAG} +FROM statusteam/status-build-base:${BASE_IMAGE_TAG} ARG RNATIVE_VERSION ARG CONAN_VERSION ARG CMAKE_VERSION +ARG GOLANG_VERSION +ARG NODE_VERSION +ENV PATH=/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN add-apt-repository -y ppa:git-core/ppa \ - && add-apt-repository -y ppa:longsleep/golang-backports \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get -q -y --no-install-recommends install \ - nsis fuse golang-go python python3-pip python3-setuptools python3-wheel \ - apt-transport-https openjdk-8-jdk-headless extra-cmake-modules build-essential \ - libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ - libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \ + nsis fuse python python3-pip python3-setuptools python3-wheel \ + apt-transport-https openjdk-8-jdk-headless extra-cmake-modules build-essential \ + libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ + libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man \ && python3 -m pip install --upgrade pip \ @@ -26,6 +28,11 @@ RUN cd /tmp \ && rm -fr /usr/local/doc/cmake \ && rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz +RUN cd /tmp \ + && wget -q https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz \ + && rm go${GOLANG_VERSION}.linux-amd64.tar.gz + RUN mkdir -p /tmp/react-native-desktop \ && cd /tmp/react-native-desktop \ && git --version \ @@ -40,6 +47,6 @@ RUN mkdir -p /tmp/react-native-desktop \ && cd \ && rm -r /tmp/react-native-desktop -LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/windows/docker" \ +LABEL source="https://github.com/status-im/status-react/tree/develop/docker/windows" \ description="Image for building Windows Desktop version of Status app." \ maintainer="jakub@status.im" diff --git a/docker/windows/Makefile b/docker/windows/Makefile index 9c5c0db230..c1dfc1e59a 100644 --- a/docker/windows/Makefile +++ b/docker/windows/Makefile @@ -4,8 +4,8 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) # WARNING: Remember to update `ci/Jenkinsfile.*` with the same IMAGE_TAG value -BASE_IMAGE_TAG = $(shell cd ../base && make get-image-tag) -DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) -d cmake -d conan -d react_native_desktop) +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 conan -d golang -d node -d react_native_desktop) IMAGE_TAG = 1.1.0-$(DEPS_HASH) IMAGE_NAME = statusteam/status-build-windows:$(IMAGE_TAG) @@ -17,9 +17,11 @@ build: docker build \ --build-arg="BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)" \ - --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \ --build-arg="CONAN_VERSION=$(call __toolversion, conan)" \ --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \ + --build-arg="GOLANG_VERSION=$(call __toolversion, golang)" \ + --build-arg="NODE_VERSION=$(call __toolversion, node)" \ + --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) .