From 67ef683b314f6f61a48ae2c576f9151f2787d653 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 8 Jan 2018 14:12:34 +0100 Subject: [pkg] create a new image for bundles --- .gitlab-ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 00c03a85..4894d80f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -165,6 +165,35 @@ build_docker_image: docker push ${CI_REGISTRY_IMAGE}:${TAG} fi +build_docker_bundle_image: + image: 0xacab.org:4567/leap/bitmask-bundler:latest + stage: publish + services: + - docker:dind + tags: + - docker-in-docker + only: + - branches@leap/bitmask-dev + before_script: + - > + export LAST_COMMIT=$(curl -s --header "PRIVATE-TOKEN: ${LEAP_CODE_O_MATIC_PRIVATE_TOKEN}" https://0xacab.org/api/v4/projects/574/pipelines | + python -c "import sys, json; print json.load(sys.stdin)[1]['sha']") + script: + - > + if git diff $LAST_COMMIT HEAD --name-only | egrep '(pkg/docker_bundle|.gitlab)' || [ "$CI_JOB_MANUAL" == "true" ] ; then + if [ "$CI_COMMIT_REF_SLUG" == "master" ] + then + TAG='latest' + else + TAG="$CI_COMMIT_REF_SLUG" + fi + docker --version + docker info + docker login -u gitlab-ci-token -e sysdev@leap.se -p $CI_JOB_TOKEN $CI_REGISTRY + docker build -t ${CI_REGISTRY_IMAGE}:${TAG} pkg/docker_bundle + docker push ${CI_REGISTRY_IMAGE}:${TAG} + fi + .job_template: &job_definition stage: publish # Only build packages for https://0xacab.org/leap/bitmask-dev, not -- cgit v1.2.3