summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2017-10-13 13:34:39 +0000
committercyberta <cyberta@riseup.net>2017-10-13 13:34:39 +0000
commit0b146ea7ce6b628c7ff56a20318e7495960dfb7c (patch)
treeff97faa119a4b0dd180e841a8118536444df9c42
parentef91d9235cccbd4dcd9e120c8fff910e0d448022 (diff)
parentca6a6bab5412dd13ab19f7043f320efe14a72dbd (diff)
Merge branch '8755_reduce_logs_during_image_creation' into 'master'
8755 redirect logs during docker image creation to an artifact file See merge request leap/bitmask_android!12
-rw-r--r--.gitlab-ci.yml8
-rwxr-xr-x.gitlab/build.sh11
-rw-r--r--docker/android-emulator/Dockerfile2
-rw-r--r--docker/android-ndk/Dockerfile2
4 files changed, 16 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bddbc547..5819f343 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,7 +24,13 @@ variables:
script:
- docker --version
- docker info
- - .gitlab/build.sh ${DOCKER_IMAGE}
+ - if ! .gitlab/build.sh ${DOCKER_IMAGE} >> dockerbuild.log 2>&1; then echo "Image build failed. Please check dockerbuild.log."; exit 1; fi;
+ allow_failure: false
+ artifacts:
+ when: on_failure
+ expire_in: 31d
+ paths:
+ - dockerbuild.log
docker_image:sdk:
stage: docker_image_sdk
diff --git a/.gitlab/build.sh b/.gitlab/build.sh
index cc63075d..6f989001 100755
--- a/.gitlab/build.sh
+++ b/.gitlab/build.sh
@@ -17,8 +17,13 @@ TAG=${2:-latest}
DOCKERFILE=docker/${DIR}/${2:-Dockerfile}${2:+.dockerfile}
TARGET=${CI_REGISTRY_IMAGE}/${DIR}:${TAG}
+function quit {
+ echo "Image build failed. Exit value: $?."
+ exit 1
+}
+
if git diff "$LAST_COMMIT" HEAD --name-only | egrep "($DOCKERFILE|^.gitlab)"; then
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
- docker build -t "$TARGET" -f "$DOCKERFILE" docker/
- docker push "$TARGET"
+ docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" || quit
+ docker build -t "$TARGET" -f "$DOCKERFILE" docker/ || quit
+ docker push "$TARGET" || quit
fi
diff --git a/docker/android-emulator/Dockerfile b/docker/android-emulator/Dockerfile
index 7cdd9b3e..bececd08 100644
--- a/docker/android-emulator/Dockerfile
+++ b/docker/android-emulator/Dockerfile
@@ -31,7 +31,7 @@ RUN apt-get update -qq && \
RUN echo y | sdkmanager "emulator"
# Install System Images for emulators
-RUN echo y | sdkmanager "system-images;android-26;google_apis;x86_64"
+RUN echo y | sdkmanager "system-images;android-26;google_apis;x86"
RUN echo y | sdkmanager "system-images;android-25;google_apis;x86_64"
RUN echo y | sdkmanager "system-images;android-24;google_apis;x86_64"
RUN echo y | sdkmanager "system-images;android-23;google_apis;x86_64"
diff --git a/docker/android-ndk/Dockerfile b/docker/android-ndk/Dockerfile
index 34d1d641..7739fa47 100644
--- a/docker/android-ndk/Dockerfile
+++ b/docker/android-ndk/Dockerfile
@@ -8,7 +8,6 @@ ENV DEBIAN_FRONTEND noninteractive
# ------------------------------------------------------
# --- Install System Dependencies
-RUN if test -f /etc/apt/sources.list.d/leap.list; then rm /etc/apt/sources.list.d/leap.list; fi
# Need docker package in order to do Docker-in-Docker (DIND)
RUN apt-get update -qq && \
apt-get -y dist-upgrade && \
@@ -22,7 +21,6 @@ RUN apt-get update -qq && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
-
# ------------------------------------------------------
# --- Install Android NDK (for running C code)