ci: move windows base image to docker image, add workdir

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Jakub Sokołowski 2019-02-26 21:58:15 +01:00 committed by Igor Mandrigin
parent 5a07956672
commit 30dc24a3a9
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
11 changed files with 49 additions and 33 deletions

View File

@ -15,4 +15,5 @@ qtci;55ffd9f225708b3aa1443851cfa8dead2c1f9959;
react_native_cli;2.0.1;
react_native_desktop;v0.56.1_4;
watchman;4.9.0;
windows_base_image;20181113;2d1a92dbef85bab94d8f7e571a5e0d10
yarn;1.13.0;

View File

@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
addressable (2.5.2)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.3)
babosa (1.0.2)
@ -16,26 +16,26 @@ GEM
digest-crc (0.4.1)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.5.0)
emoji_regex (0.1.1)
dotenv (2.7.1)
emoji_regex (1.0.1)
excon (0.62.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.12.2)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.112.0)
fastlane (2.116.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (~> 0.1)
emoji_regex (>= 0.1, < 2.0)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
@ -76,15 +76,15 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
google-cloud-core (1.2.7)
google-cloud-core (1.3.0)
google-cloud-env (~> 1.0)
google-cloud-env (1.0.5)
faraday (~> 0.11)
google-cloud-storage (1.15.0)
google-cloud-storage (1.16.0)
digest-crc (~> 0.4)
google-api-client (~> 0.23)
google-cloud-core (~> 1.2)
googleauth (~> 0.6.2)
googleauth (>= 0.6.2, < 0.10.0)
googleauth (0.6.7)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
@ -96,7 +96,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
json (2.1.0)
json (2.2.0)
jwt (2.1.0)
memoist (0.16.0)
mime-types (3.2.2)
@ -110,7 +110,7 @@ GEM
naturally (2.2.0)
netrc (0.11.0)
os (1.0.0)
plist (3.4.0)
plist (3.5.0)
public_suffix (2.0.5)
representable (3.0.4)
declarative (< 0.1.0)
@ -144,9 +144,9 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
unicode-display_width (1.4.1)
word_wrap (1.0.0)
xcodeproj (1.7.0)
xcodeproj (1.8.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)

View File

@ -3,7 +3,7 @@ pipeline {
docker {
label 'linux'
/* WARNING: remember to keep this up-to-date with the value in docker/android/Makefile */
image 'statusteam/status-build-android:1.1.0-16a42e06'
image 'statusteam/status-build-android:1.1.1-cd1596b3'
args (
"-v /home/jenkins/tmp:/var/tmp:rw "+
"-v /home/jenkins/status-im.keystore:/tmp/status-im.keystore:ro"

View File

@ -2,9 +2,9 @@ pipeline {
agent {
/* privileged mode is necessary for fuse */
docker {
label 'linux-new'
label 'linux'
/* WARNING: remember to keep this up-to-date with the value in docker/linux/Makefile */
image 'statusteam/status-build-linux:1.1.0-2a35dcde'
image 'statusteam/status-build-linux:1.1.1-8e5f6658'
args (
"-v /var/tmp/lein:/var/tmp/lein:rw "+
"-v /var/tmp/npm:/var/tmp/npm:rw "+

View File

@ -4,13 +4,12 @@ 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-fb116054'
image 'statusteam/status-build-windows:1.1.1-67cf7368'
args (
"--privileged "+
"-v /dev/fuse:/dev/fuse "+
"-v /var/tmp/lein:/var/tmp/lein:rw "+
"-v /var/tmp/npm:/var/tmp/npm:rw "+
"-v /opt/StatusIm-Windows-base-image_20181113.zip:/opt/StatusIm-Windows-base-image.zip:ro"
"-v /var/tmp/npm:/var/tmp/npm:rw "
)
}
}
@ -50,7 +49,6 @@ pipeline {
CONAN_PRINT_RUN_COMMANDS = '1'
CONAN_SYSREQUIRES_MODE = 'disabled'
CONAN_SYSREQUIRES_SUDO = '0'
STATUSIM_WINDOWS_BASEIMAGE_ZIP = '/opt/StatusIm-Windows-base-image.zip'
VERBOSE_LEVEL = '3'
}

View File

@ -23,7 +23,7 @@ DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -b $(BASE_IMAGE_TAG) \
-d android-sdk \
-d android-sdk-platform \
-d android-sdk-build-tools)
IMAGE_TAG = 1.1.0-$(DEPS_HASH)
IMAGE_TAG = 1.1.1-$(DEPS_HASH)
IMAGE_NAME = statusteam/status-build-android:$(IMAGE_TAG)
build: $(ANDROID_NDK_ARCHIVE) $(ANDROID_SDK_ARCHIVE)

View File

@ -24,7 +24,8 @@ RUN mkdir /var/tmp/npm /var/tmp/lein \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
file jq git wget zip unzip s3cmd build-essential nodejs locales \
file autoconf automake libtool build-essential \
jq git wget zip unzip s3cmd nodejs locales \
ca-certificates oracle-java8-installer oracle-java8-set-default \
&& locale-gen ${LANG} \
&& npm install -g yarn@${YARN_VERSION} \
@ -32,10 +33,10 @@ RUN mkdir /var/tmp/npm /var/tmp/lein \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
# These are the UID and GID values used by Jenkins
RUN addgroup --gid 1002 jenkins \
RUN addgroup --gid 1001 jenkins \
&& adduser --shell /bin/bash \
--disabled-password --gecos "" \
--uid 1001 --gid 1002 jenkins \
--uid 1001 --gid 1001 jenkins \
&& su jenkins -c "git config --global user.email 'jenkins'" \
&& su jenkins -c "git config --global user.name 'jenkins@status.im'"
@ -52,6 +53,8 @@ RUN su -l jenkins -c \
nvm install ${NODE_VERSION} && \
nvm alias default ${NODE_VERSION}"
WORKDIR /home/jenkins
LABEL source="https://github.com/status-im/status-react/tree/develop/docker/base" \
description="Base Image used for building Status app." \
maintainer="jakub@status.im"

View File

@ -5,12 +5,9 @@ GIT_ROOT = $(shell git rev-parse --show-toplevel)
# WARNING: Remember to change the tag when updating the image
DEPS_HASH = $(shell $(GIT_ROOT)/scripts/gen-deps-hash.sh -d leiningen -d node -d yarn)
IMAGE_TAG = 1.1.0-$(DEPS_HASH)
IMAGE_TAG = 1.1.1-$(DEPS_HASH)
IMAGE_NAME = statusteam/status-build-base:$(IMAGE_TAG)
get-image-tag:
@echo $(IMAGE_TAG)
build: nvm_install.sh
docker build \
--build-arg="LEIN_VERSION=$(call __toolversion, leiningen)" \
@ -24,3 +21,6 @@ nvm_install.sh:
push: build
docker push $(IMAGE_NAME)
get-image-tag:
@echo $(IMAGE_TAG)

View File

@ -12,7 +12,7 @@ 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 $(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_TAG = 1.1.1-$(DEPS_HASH)
IMAGE_NAME = statusteam/status-build-linux:$(IMAGE_TAG)
build: $(QT_ARCHIVE)

View File

@ -7,6 +7,7 @@ ARG CONAN_VERSION
ARG CMAKE_VERSION
ARG GOLANG_VERSION
ARG NODE_VERSION
ARG WIN_BASE_IMAGE_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 \
@ -47,6 +48,9 @@ RUN mkdir -p /tmp/react-native-desktop \
&& cd \
&& rm -r /tmp/react-native-desktop
ADD ./StatusIm-Windows-base-image_${WIN_BASE_IMAGE_VERSION}.zip /opt/StatusIm-Windows-base-image.zip
ENV STATUSIM_WINDOWS_BASEIMAGE_ZIP=/opt/StatusIm-Windows-base-image.zip
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"

View File

@ -5,11 +5,16 @@ 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 $(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)
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)
IMAGE_NAME = statusteam/status-build-windows:$(IMAGE_TAG)
build:
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)
@ if [ "${DEPS_HASH}" = "" ]; then \
echo "DEPS_HASH not set"; \
exit 1; \
@ -22,8 +27,13 @@ build:
--build-arg="GOLANG_VERSION=$(call __toolversion, golang)" \
--build-arg="NODE_VERSION=$(call __toolversion, node)" \
--build-arg="RNATIVE_VERSION=$(call __toolversion, react_native_desktop)" \
--build-arg="WIN_BASE_IMAGE_VERSION=$(WIN_BASE_IMAGE_VER)" \
--label="commit=$(GIT_COMMIT)" \
-t $(IMAGE_NAME) .
$(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
push: build
docker push $(IMAGE_NAME)