diff options
author | Kali Kaneko <kali@leap.se> | 2018-01-08 14:12:34 +0100 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2018-01-08 14:12:34 +0100 |
commit | 67ef683b314f6f61a48ae2c576f9151f2787d653 (patch) | |
tree | 7d97a59ec285ab6e81a6361964fc0452373e4916 /.gitlab-ci.yml | |
parent | 3eed5db28036e65fe19f1c1c25ad4d6353eda3c1 (diff) |
[pkg] create a new image for bundles
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 29 |
1 files changed, 29 insertions, 0 deletions
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 |