diff options
author | Varac <varac@leap.se> | 2017-09-25 16:52:04 +0200 |
---|---|---|
committer | Varac <varac@leap.se> | 2017-09-25 19:13:33 +0200 |
commit | d944721a35786a48b996ef088f0311b1835180a7 (patch) | |
tree | 6c9194a5b85dd761e80c5658c1c8d69f5453dd3d /.gitlab-ci.yml | |
parent | 64e961fe8ebc1eeb331cef2604cf4c8714e8d8ad (diff) |
Build docker images from CI
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 47 |
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: |