diff --git a/.TOOLVERSIONS b/.TOOLVERSIONS index 57a8c926db..d1df48d0a0 100644 --- a/.TOOLVERSIONS +++ b/.TOOLVERSIONS @@ -1,12 +1,17 @@ -ANDROID_BUILD_TOOLS_VERSION;28.0.1; -ANDROID_NDK_VERSION;r10e; -ANDROID_PLATFORM_VERSION;android-27; +android-ndk;r10e;070be287539e3e7706f8dabfb6bf9879 +android-sdk-build-tools;28.0.1; +android-sdk-platform;android-27; +android-sdk;4333796;aa190cfd7299cd6a1c687355bb2764e4 clojure_cli;1.9.0.381; +cmake;3.12.2; conan;1.9.0; leiningen;2.8.1; maven;3.5.2; node;10.12.0; nvm;0.33.11; +qt;5.11.2;974fda61267cfb6e45984ee5f0a285f8 +qtci;55ffd9f225708b3aa1443851cfa8dead2c1f9959; react_native_cli;2.0.1; +react_native_desktop;v0.56.1_4; watchman;4.9.0; yarn;1.13.0; diff --git a/.gitignore b/.gitignore index 0685ad53a7..576b4602a3 100644 --- a/.gitignore +++ b/.gitignore @@ -66,8 +66,10 @@ index.desktop.js # Docker # +docker/*/scripts/ docker/*/*.zip docker/*/*.run +docker/*/nvm_install.sh # Generated by lein voom # @@ -153,7 +155,6 @@ Status-Windows-x86_64.exe /desktop/CMakeFiles/ /desktop/reportApp/Makefile /deployment/windows/Status.rc -/docker/*/scripts/ *_autogen/ CompleteBundleWin.cmake logger_settings.ini diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index cdec5675c0..2e7d3b13f7 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -2,7 +2,7 @@ pipeline { agent { docker { label 'linux' - image 'statusteam/status-build-android:1.0.1' + image 'statusteam/status-build-android:1.1.0' args ( "-v /home/jenkins/tmp:/var/tmp:rw "+ "-v /home/jenkins/status-im.keystore:/tmp/status-im.keystore:ro" @@ -59,34 +59,30 @@ pipeline { cmn = load 'ci/common.groovy' print "Running ${cmn.getBuildType()} build!" cmn.abortPreviousRunningBuilds() - /* Read the valid NodeJS version */ - env.NODE_VERSION = cmn.getToolVersion('node') /* Cleanup and Prep */ - nvm(env.NODE_VERSION) { - mobile.prep(cmn.getBuildType()) - } + mobile.prep(cmn.getBuildType()) } } } stage('Lint') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runLint() } - } } + } } stage('Tests') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runTests() } - } } + } } stage('Build') { - steps { nvm(env.NODE_VERSION) { + steps { script { mobile.leinBuild('android') } - } } + } } stage('Bundle') { - steps { nvm(env.NODE_VERSION) { + steps { script { apk = mobile.android.bundle(cmn.getBuildType()) } - } } + } } stage('Archive') { steps { diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index a5fe9db61a..4eeb374032 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -3,7 +3,7 @@ pipeline { /* privileged mode is necessary for fuse */ docker { label 'linux-new' - image 'statusteam/linux-desktop-ubuntu:1.1.1' + image 'statusteam/status-build-linux:1.1.0' args ( "--privileged "+ "-v /dev/fuse:/dev/fuse "+ @@ -59,34 +59,30 @@ pipeline { cmn = load 'ci/common.groovy' print "Running ${cmn.getBuildType()} build!" cmn.abortPreviousRunningBuilds() - /* Read the valid NodeJS version */ - env.NODE_VERSION = cmn.getToolVersion('node') /* Cleanup and Prep */ - nvm(env.NODE_VERSION) { - desktop.prepDeps() - } + desktop.prepDeps() } } } stage('Lint') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runLint() } - } } + } } stage('Tests') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runTests() } - } } + } } stage('Build') { - steps { nvm(env.NODE_VERSION) { + steps { script { desktop.buildClojureScript() } - } } + } } stage('Compile') { - steps { nvm(env.NODE_VERSION) { + steps { script { desktop.compile() } - } } + } } stage('Bundle') { steps { diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index 7dfb291b06..6778e04e2e 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -3,7 +3,7 @@ pipeline { /* privileged mode is necessary for fuse */ docker { label 'linux-new' - image 'statusteam/windows-desktop-ubuntu:1.1.1' + image 'statusteam/status-build-windows:1.1.0' args ( "--privileged "+ "-v /dev/fuse:/dev/fuse "+ @@ -62,34 +62,30 @@ pipeline { cmn = load 'ci/common.groovy' print "Running ${cmn.getBuildType()} build!" cmn.abortPreviousRunningBuilds() - /* Read the valid NodeJS version */ - env.NODE_VERSION = cmn.getToolVersion('node') /* Cleanup and Prep */ - nvm(env.NODE_VERSION) { - desktop.prepDeps() - } + desktop.prepDeps() } } } stage('Lint') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runLint() } - } } + } } stage('Tests') { - steps { nvm(env.NODE_VERSION) { + steps { script { cmn.runTests() } - } } + } } stage('Build') { - steps { nvm(env.NODE_VERSION) { + steps { script { desktop.buildClojureScript() } - } } + } } stage('Compile') { - steps { nvm(env.NODE_VERSION) { + steps { script { desktop.compile() } - } } + } } stage('Bundle') { steps { diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile index 315ea0921f..309dd401b6 100644 --- a/docker/android/Dockerfile +++ b/docker/android/Dockerfile @@ -1,11 +1,17 @@ # This image is only for extracting and cleaning up NDK and SDK -FROM statusteam/status-build-base:1.0.0 AS sdk_and_ndk +FROM statusteam/status-build-base:1.1.0 AS sdk_and_ndk ARG ANDROID_NDK_VERSION ARG ANDROID_SDK_VERSION +ARG SDK_PLATFORM_VERSION +ARG SDK_BUILD_TOOLS_VERSION # names of packages to install with sdkmanager -ENV SDK_PACKAGES emulator patcher;v4 build-tools;26.0.2 platforms;android-26 platforms;android-27 platforms;android-28 extras;android;m2repository extras;google;m2repository +ENV SDK_PACKAGES emulator patcher;v4 \ + platforms;android-26 \ + platforms;${SDK_PLATFORM_VERSION} \ + build-tools;${SDK_BUILD_TOOLS_VERSION} \ + extras;android;m2repository extras;google;m2repository # install SDK COPY sdk-tools-linux-${ANDROID_SDK_VERSION}.zip /tmp/sdk-tools-linux.zip @@ -32,7 +38,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.0.0 +FROM statusteam/status-build-base:1.1.0 ARG ANDROID_NDK_VERSION ARG ANDROID_SDK_VERSION diff --git a/docker/android/Makefile b/docker/android/Makefile index 1e1718a84d..ed4094f0f5 100644 --- a/docker/android/Makefile +++ b/docker/android/Makefile @@ -1,24 +1,31 @@ +__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1)) + GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) -ANDROID_NDK_VERSION = r10e -ANDROID_NDK_CHECKSUM = 070be287539e3e7706f8dabfb6bf9879 +ANDROID_NDK_VERSION = $(call __toolversion, android-ndk) +ANDROID_NDK_CHECKSUM = $(call __toolversion, android-ndk_md5) 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 = 4333796 -ANDROID_SDK_CHECKSUM = aa190cfd7299cd6a1c687355bb2764e4 +ANDROID_SDK_VERSION = $(call __toolversion, android-sdk) +ANDROID_SDK_CHECKSUM = $(call __toolversion, android-sdk_md5) 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 +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 -IMAGE_TAG = 1.0.1 +IMAGE_TAG = 1.1.0 IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG) build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE) docker build \ --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)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) . diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 3992609640..f7b036547e 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -1,17 +1,19 @@ FROM ubuntu:16.04 -ARG NVM_VERSION -ARG NVM_NODE_VERSION +ARG NODE_VERSION +ARG YARN_VERSION ARG LEIN_VERSION # We have to do this because Jenkins doesn't let us # https://issues.jenkins-ci.org/browse/JENKINS-49076 -ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ +ENV PATH=/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ LANG=en_US.UTF-8 \ LC_ALL=en_US.UTF-8 \ LANGUAGE=en_US.UTF-8 \ LEIN_HOME=/var/tmp/lein \ - YARN_CACHE_FOLDER=/var/tmp/yarn + LEIN_URL=https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein \ + YARN_CACHE_FOLDER=/var/tmp/yarn \ + NVM_DIR=/home/jenkins/.nvm RUN mkdir /var/tmp/npm /var/tmp/lein \ && chmod 777 /var/tmp/npm /var/tmp/lein \ @@ -20,13 +22,12 @@ RUN mkdir /var/tmp/npm /var/tmp/lein \ && echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \ && echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \ && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \ - file git wget zip unzip s3cmd build-essential nodejs yarn locales \ + file jq git wget zip unzip s3cmd build-essential nodejs locales \ ca-certificates oracle-java8-installer oracle-java8-set-default \ && locale-gen ${LANG} \ + && npm install -g yarn@${YARN_VERSION} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man @@ -39,14 +40,17 @@ RUN addgroup --gid 1002 jenkins \ && su jenkins -c "git config --global user.name 'jenkins@status.im'" # Leiningen setup -RUN wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein -O /usr/local/bin/lein \ +RUN wget ${LEIN_URL} -O /usr/local/bin/lein \ && chmod 755 /usr/local/bin/lein \ && lein version # Install NVM for Jenkins -RUN su jenkins -c "\ - curl -s -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash && \ - source ~/.nvm/nvm.sh && nvm install ${NVM_NODE_VERSION} && nvm alias default ${NVM_NODE_VERSION}" +ADD nvm_install.sh /tmp/nvm_install.sh +RUN su -l jenkins -c \ + "bash /tmp/nvm_install.sh && \ + . ${NVM_DIR}/nvm.sh && \ + nvm install ${NODE_VERSION} && \ + nvm alias default ${NODE_VERSION}" LABEL source="https://github.com/status-im/status-react/tree/develop/docker/base" \ description="Base Image used for building Status app." \ diff --git a/docker/base/Makefile b/docker/base/Makefile index 3fa4bc33ef..928d4d1e37 100644 --- a/docker/base/Makefile +++ b/docker/base/Makefile @@ -1,23 +1,22 @@ +__toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1)) + GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) -# Software Versions, URLs, and Checksums -NVM_VERSION = v0.33.11 -NVM_INSTALL_SCRIPT = nvm_$(NVM_VERSION)_install.sh -NVM_NODE_VERSION = v10.14.0 -LEIN_VERSION = stable - # WARNING: Remember to change the tag when updating the image -IMAGE_TAG = 1.0.0 +IMAGE_TAG = 1.1.0 IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG) -build: +build: nvm_install.sh docker build \ - --build-arg="LEIN_VERSION=$(LEIN_VERSION)" \ - --build-arg="NVM_VERSION=$(NVM_VERSION)" \ - --build-arg="NVM_NODE_VERSION=$(NVM_NODE_VERSION)" \ + --build-arg="LEIN_VERSION=$(call __toolversion, leiningen)" \ + --build-arg="NODE_VERSION=$(call __toolversion, node)" \ + --build-arg="YARN_VERSION=$(call __toolversion, yarn)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) . +nvm_install.sh: + cp $(GIT_ROOT)/scripts/3rd-party/nvm/$(call __toolversion, nvm)/install.sh nvm_install.sh + push: build docker push $(IMAGE_NAME) diff --git a/docker/linux/Dockerfile b/docker/linux/Dockerfile index 78fc55691c..1e4b2b458e 100644 --- a/docker/linux/Dockerfile +++ b/docker/linux/Dockerfile @@ -1,14 +1,17 @@ -FROM ubuntu:16.04 AS qt_build +FROM statusteam/status-build-base:1.1.0 AS qt_build ARG QT_VERSION -ARG REACT_NATIVE_DESKTOP_COMMIT_SHA -ARG QT_CI_COMMIT_SHA +ARG RNATIVE_VERSION +ARG QT_CI_COMMIT -RUN apt-get update && apt-get -q -y --no-install-recommends install software-properties-common && \ - add-apt-repository -y ppa:git-core/ppa && \ - apt-get update && apt-get -y install \ - git libx11-xcb1 libxss1 libasound2 libfontconfig1 libdbus-1-3 && \ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +ENV XDG_RUNTIME_DIR=/tmp/runtime-root + +RUN apt-get update \ + && add-apt-repository -y ppa:git-core/ppa \ + && apt-get update \ + && apt-get -y install git libx11-xcb1 libxss1 libasound2 libfontconfig1 libdbus-1-3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # This variable defines which parts of QT will be extracted from the .run file. # You can list available packages in a Qt .run file by using: @@ -21,93 +24,63 @@ ENV QT_CI_PACKAGES qt.qt5.5112.gcc_64,qt.qt5.5112.qtwebengine.gcc_64 # NOTE: Unfortunately GitHub doesn't support cloning a specific SHA1, so we need to # resort to git fetch (https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset) ADD qt-opensource-linux-x64-${QT_VERSION}.run /tmp/ -RUN mkdir -p /tmp/qtci && cd /tmp/qtci && \ - git init && git remote add origin https://github.com/benlau/qtci.git && \ - git fetch --depth=1 origin ${QT_CI_COMMIT_SHA} && \ - git reset --hard FETCH_HEAD && \ - /tmp/qtci/bin/extract-qt-installer --disable-progress-report \ - /tmp/qt-opensource-linux-x64-${QT_VERSION}.run /opt/qt-all && \ - find /opt/qt-all/${QT_VERSION}/gcc_64/bin -type f -regextype posix-egrep -regex \ - '.*\/(qdoc|qgltf|linguist|designer|assistant|qhelpconverter|qmlprofiler)$' -delete +RUN mkdir -p /tmp/qtci \ + && cd /tmp/qtci \ + && git init \ + && git remote add origin https://github.com/benlau/qtci.git \ + && git fetch --depth=1 origin ${QT_CI_COMMIT} \ + && git reset --hard FETCH_HEAD \ + && /tmp/qtci/bin/extract-qt-installer --disable-progress-report \ + /tmp/qt-opensource-linux-x64-${QT_VERSION}.run /opt/qt-all \ + && find /opt/qt-all/${QT_VERSION}/gcc_64/bin -type f -regextype posix-egrep -regex \ + '.*\/(qdoc|qgltf|linguist|designer|assistant|qhelpconverter|qmlprofiler)$' -delete \ + && rm -fr ${XDG_RUNTIME_DIR} -FROM ubuntu:16.04 +FROM statusteam/status-build-base:1.1.0 ARG QT_VERSION +ARG CMAKE_VERSION COPY --from=qt_build /opt/qt-all/${QT_VERSION}/gcc_64 /opt/qt -RUN ln -s /opt/qt/mkspecs /usr/local/mkspecs && \ - ln -s /opt/qt/plugins /usr/local/plugins - -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 -ENV LEIN_HOME /var/tmp/lein -ENV NPM_CONFIG_CACHE /var/tmp/npm +RUN ln -s /opt/qt/mkspecs /usr/local/mkspecs \ + && ln -s /opt/qt/plugins /usr/local/plugins # We have to do this because Jenkins doesn't let us # https://issues.jenkins-ci.org/browse/JENKINS-49076 ENV PATH /opt/qt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -RUN apt-get update && apt-get -q -y --no-install-recommends install curl software-properties-common && \ - add-apt-repository -y ppa:git-core/ppa && \ - add-apt-repository -y ppa:longsleep/golang-backports && \ - apt-get remove -y software-properties-common && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive \ +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 \ - wget git unzip golang-go file s3cmd \ - python python3-pip python3-setuptools python3-wheel \ - apt-transport-https locales openjdk-8-jdk-headless \ + 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 && \ - locale-gen en_US.UTF-8 && \ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man + libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man -RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \ - tar xf cmake-3.12.2-Linux-x86_64.tar.gz --strip 1 -C /usr/local && \ - rm -fr /usr/local/doc/cmake && rm cmake-3.12.2-Linux-x86_64.tar.gz +RUN cd /tmp \ + && wget -q https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \ + && tar xf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip 1 -C /usr/local \ + && rm -fr /usr/local/doc/cmake \ + && rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -ARG LEIN_VERSION -ENV LEIN_INSTALL=/usr/bin/ - -RUN mkdir -p $LEIN_INSTALL \ - && wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein-pkg \ - && mv lein-pkg $LEIN_INSTALL/lein \ - && chmod 0755 $LEIN_INSTALL/lein \ - && wget -q https://github.com/technomancy/leiningen/releases/download/${LEIN_VERSION}/leiningen-${LEIN_VERSION}-standalone.zip \ - && mkdir -p /usr/share/java \ - && mv leiningen-${LEIN_VERSION}-standalone.zip /usr/share/java/leiningen-${LEIN_VERSION}-standalone.jar \ - && $LEIN_INSTALL/lein version - -ARG NVM_VERSION -ARG NODE_VERSION -ARG YARN_VERSION -ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/ - -RUN /tmp/nvm/${NVM_VERSION}/install.sh && \ - mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \ - git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \ - git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \ - git reset --hard FETCH_HEAD && \ - cp -r /tmp/react-native-desktop/react-native-cli /opt && \ - cd /opt/react-native-cli && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install ${NODE_VERSION} && \ - nvm use ${NODE_VERSION} && \ - npm install -g yarn@${YARN_VERSION} && \ - npm update && npm install -g && \ - cd && rm -r /tmp/react-native-desktop - -# These are the UID and GID values used by Jenkins -RUN addgroup --gid 1002 jenkins && \ - adduser --shell /bin/bash \ - --disabled-password --gecos "" \ - --uid 1001 --gid 1002 jenkins - -# Install NVM for Jenkins -RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh' +RUN mkdir -p /tmp/react-native-desktop \ + && cd /tmp/react-native-desktop \ + && git init \ + && git remote add origin https://github.com/status-im/react-native-desktop.git \ + && git fetch --quiet --depth=1 origin ${RNATIVE_VERSION} \ + && git reset --hard FETCH_HEAD \ + && cp -r /tmp/react-native-desktop/react-native-cli /opt \ + && cd /opt/react-native-cli \ + && npm update \ + && npm install -g --prefix /usr/local \ + && cd \ + && rm -r /tmp/react-native-desktop LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/docker" \ description="Image for building Linux Desktop version of Status app." \ diff --git a/docker/linux/Makefile b/docker/linux/Makefile index 2367ac7530..c111c19fef 100644 --- a/docker/linux/Makefile +++ b/docker/linux/Makefile @@ -3,37 +3,26 @@ __toolversion = $(shell $(GIT_ROOT)/scripts/toolversion $(1)) GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) -# WARNING: Change version in Dockerfile too -QT_VERSION = 5.11.2 -QT_VER_MJR = 5.11 +QT_VERSION = $(call __toolversion, qt) +QT_MD5SUM = $(call __toolversion, qt_md5) QT_ARCHIVE = qt-opensource-linux-x64-$(QT_VERSION).run -QT_MD5SUM = 974fda61267cfb6e45984ee5f0a285f8 QT_URL = https://download.qt.io/archive/qt -QT_CI_COMMIT_SHA = 55ffd9f225708b3aa1443851cfa8dead2c1f9959 -REACT_NATIVE_DESKTOP_COMMIT_SHA = 2a76c435a27f0bf6c089f74222212b3a58e10385 # WARNING: Remember to change the tag when updating the image -IMAGE_TAG = 1.1.1 -IMAGE_NAME = statusteam/linux-desktop-ubuntu:$(IMAGE_TAG) +IMAGE_TAG = 1.1.0 +IMAGE_NAME = statusteam/status-build-linux:$(IMAGE_TAG) build: $(QT_ARCHIVE) - rm -rf ./scripts && \ - mkdir -p ./scripts/3rd-party && \ - cp -R ../../scripts/3rd-party/ ./scripts/ && \ docker build \ --build-arg="QT_VERSION=$(QT_VERSION)" \ - --build-arg="QT_CI_COMMIT_SHA=$(QT_CI_COMMIT_SHA)" \ - --build-arg="REACT_NATIVE_DESKTOP_COMMIT_SHA=$(REACT_NATIVE_DESKTOP_COMMIT_SHA)" \ - --build-arg="LEIN_VERSION=$(call __toolversion,lein)" \ - --build-arg="NODE_VERSION=$(call __toolversion,node)" \ - --build-arg="NVM_VERSION=$(call __toolversion,nvm)" \ - --build-arg="YARN_VERSION=$(call __toolversion,yarn)" \ + --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) .; \ - rm -rf ./scripts $(QT_ARCHIVE): - wget $(QT_URL)/$(QT_VER_MJR)/$(QT_VERSION)/$(QT_ARCHIVE) + wget $(QT_URL)/$(call __major_version__, $(QT_VERSION))/$(QT_VERSION)/$(QT_ARCHIVE) echo "$(QT_MD5SUM) $(QT_ARCHIVE)" | md5sum --check push: build diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile index ab4d318a16..cf50a40e34 100644 --- a/docker/windows/Dockerfile +++ b/docker/windows/Dockerfile @@ -1,79 +1,42 @@ -FROM ubuntu:16.04 - -ARG REACT_NATIVE_DESKTOP_COMMIT_SHA - -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 -ENV LEIN_HOME /var/tmp/lein -ENV NPM_CONFIG_CACHE /var/tmp/npm -# We have to do this because Jenkins doesn't let us -# https://issues.jenkins-ci.org/browse/JENKINS-49076 -ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +FROM statusteam/status-build-base:1.1.0 +ARG RNATIVE_VERSION ARG CONAN_VERSION +ARG CMAKE_VERSION -RUN apt-get update && apt-get -q -y --no-install-recommends install curl software-properties-common && \ - add-apt-repository -y ppa:git-core/ppa && \ - add-apt-repository -y ppa:longsleep/golang-backports && \ - apt-get remove -y software-properties-common && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive \ +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 \ - wget git nsis unzip golang-go file jq s3cmd \ - python python3-pip python3-setuptools python3-wheel \ - apt-transport-https locales openjdk-8-jdk-headless \ - extra-cmake-modules build-essential fuse \ - libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \ - libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \ - locale-gen en_US.UTF-8 && \ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && \ - python3 -m pip install --upgrade pip && \ - pip3 install conan==${CONAN_VERSION} + 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 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man \ + && python3 -m pip install --upgrade pip \ + && pip3 install conan==${CONAN_VERSION} -RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \ - tar xf cmake-3.12.2-Linux-x86_64.tar.gz --strip 1 -C /usr/local && \ - rm -fr /usr/local/doc/cmake && rm cmake-3.12.2-Linux-x86_64.tar.gz +RUN cd /tmp \ + && wget -q https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \ + && tar xf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip 1 -C /usr/local \ + && rm -fr /usr/local/doc/cmake \ + && rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -ARG LEIN_VERSION -ENV LEIN_INSTALL=/usr/bin/ - -RUN mkdir -p $LEIN_INSTALL \ - && wget -q https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein-pkg \ - && mv lein-pkg $LEIN_INSTALL/lein \ - && chmod 0755 $LEIN_INSTALL/lein \ - && wget -q https://github.com/technomancy/leiningen/releases/download/${LEIN_VERSION}/leiningen-${LEIN_VERSION}-standalone.zip \ - && mkdir -p /usr/share/java \ - && mv leiningen-${LEIN_VERSION}-standalone.zip /usr/share/java/leiningen-${LEIN_VERSION}-standalone.jar \ - && $LEIN_INSTALL/lein version - -ARG NVM_VERSION -ARG NODE_VERSION -ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/ - -RUN /tmp/nvm/${NVM_VERSION}/install.sh && \ - mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \ - git --version && \ - git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \ - git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \ - git reset --hard FETCH_HEAD && \ - cp -r /tmp/react-native-desktop/react-native-cli /opt && \ - cd /opt/react-native-cli && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install ${NODE_VERSION} && \ - nvm use ${NODE_VERSION} && \ - npm update && npm install -g && \ - cd && rm -r /tmp/react-native-desktop - -# These are the UID and GID values used by Jenkins -RUN addgroup --gid 1002 jenkins && \ - adduser --shell /bin/bash \ - --disabled-password --gecos "" \ - --uid 1001 --gid 1002 jenkins - -# Install NVM for Jenkins -RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh' +RUN mkdir -p /tmp/react-native-desktop \ + && cd /tmp/react-native-desktop \ + && git --version \ + && git init \ + && git remote add origin https://github.com/status-im/react-native-desktop.git \ + && git fetch --depth=1 origin ${RNATIVE_VERSION} \ + && git reset --hard FETCH_HEAD \ + && cp -r /tmp/react-native-desktop/react-native-cli /opt \ + && cd /opt/react-native-cli \ + && npm update \ + && npm install -g --prefix /usr/local \ + && cd \ + && rm -r /tmp/react-native-desktop LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/windows/docker" \ description="Image for building Windows Desktop version of Status app." \ diff --git a/docker/windows/Makefile b/docker/windows/Makefile index 9d9f44c0ed..06c179688c 100644 --- a/docker/windows/Makefile +++ b/docker/windows/Makefile @@ -4,24 +4,16 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_ROOT = $(shell git rev-parse --show-toplevel) # WARNING: Remember to change the tag when updating the image -IMAGE_TAG = 1.1.1 -IMAGE_NAME = statusteam/windows-desktop-ubuntu:$(IMAGE_TAG) - -REACT_NATIVE_DESKTOP_COMMIT_SHA = 2a76c435a27f0bf6c089f74222212b3a58e10385 +IMAGE_TAG = 1.1.0 +IMAGE_NAME = statusteam/status-build-windows:$(IMAGE_TAG) build: - rm -rf ./scripts && \ - mkdir -p ./scripts/3rd-party && \ - cp -R ../../scripts/3rd-party/ ./scripts/ && \ docker build \ - --build-arg="REACT_NATIVE_DESKTOP_COMMIT_SHA=$(REACT_NATIVE_DESKTOP_COMMIT_SHA)" \ - --build-arg="CONAN_VERSION=$(call __toolversion,conan)" \ - --build-arg="LEIN_VERSION=$(call __toolversion,lein)" \ - --build-arg="NODE_VERSION=$(call __toolversion,node)" \ - --build-arg="NVM_VERSION=$(call __toolversion,nvm)" \ + --build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \ + --build-arg="CONAN_VERSION=$(call __toolversion, conan)" \ + --build-arg="CMAKE_VERSION=$(call __toolversion, cmake)" \ --label="commit=$(GIT_COMMIT)" \ -t $(IMAGE_NAME) .; \ - rm -rf ./scripts push: build docker push $(IMAGE_NAME)