Commit c8ce0694 authored by ale's avatar ale

Build Docker image in CI

parent 2bc9ce19
...@@ -13,3 +13,32 @@ run_tests: ...@@ -13,3 +13,32 @@ run_tests:
- "apt-get update" - "apt-get update"
- "apt-get install --no-install-recommends -q -y crm114 tox python2 python3" - "apt-get install --no-install-recommends -q -y crm114 tox python2 python3"
- "tox -e py27,py3" - "tox -e py27,py3"
# The Docker build piggybacks on the debian package build stages.
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
GIT_SUBMODULE_STRATEGY: recursive
docker_build:
image: docker:latest
services:
- docker:dind
stage: build_pkg
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
- docker build --build-arg ci_token=$CI_JOB_TOKEN --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release:
image: docker:latest
services:
- docker:dind
stage: upload_pkg
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
only:
- master
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment