summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorVarac <varac@leap.se>2017-09-25 16:52:04 +0200
committercyBerta <cyberta@riseup.net>2017-09-29 08:56:24 +0200
commite0aa1cd978f978ed3ac90adaf8415b60ce039c79 (patch)
tree654bb43e24f219b0d493951052639cbe774a6b83 /.gitlab-ci.yml
parent65dbc986bf6d965591971dafd10b69f9fe04682c (diff)
Build docker images from CI
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml47
1 files changed, 42 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6f8f92c8..a9e43504 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,15 +1,52 @@
-image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
-
+---
stages:
+ - docker_image_sdk
+ - docker_image_other
- build
-before_script:
- - git submodule sync --recursive
- - git submodule update --init --recursive
+# When using dind, it's wise to use the overlayfs driver for
+# improved performance.
+variables:
+ DOCKER_DRIVER: overlay
+
+.job_template: &build_docker_image
+ image: 0xacab.org:4567/leap/docker/debian:stretch_amd64
+ tags:
+ - docker-in-docker
+ services:
+ - docker:dind
+ script:
+ - docker --version
+ - docker info
+ - >
+ export LAST_COMMIT=$(curl -s --header "PRIVATE-TOKEN: ${LEAP_CODE_O_MATIC_PRIVATE_TOKEN}" https://0xacab.org/api/v4/projects/578/pipelines |
+ python -c "import sys, json; print json.load(sys.stdin)[1]['sha']")
+ - .gitlab/build.sh ${DOCKER_IMAGE}
+
+docker_image:sdk:
+ stage: docker_image_sdk
+ variables:
+ DOCKER_IMAGE: android-sdk
+ <<: *build_docker_image
+
+docker_image:ndk:
+ stage: docker_image_other
+ variables:
+ DOCKER_IMAGE: android-ndk
+ <<: *build_docker_image
+
+docker_image:emulator:
+ stage: docker_image_other
+ variables:
+ DOCKER_IMAGE: android-emulator
+ <<: *build_docker_image
build:
+ image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
+ - git submodule sync --recursive
+ - git submodule update --init --recursive
- ./gradlew assembleDebug
artifacts:
paths: