Commit 37493ec6 authored by Pietro Saccardi's avatar Pietro Saccardi

Add automatic push to Docker hub

parent 7a79321e
Pipeline #856 failed with stages
in 15 minutes and 41 seconds
......@@ -4,6 +4,7 @@ stages:
- test
- docs
- bundle
- publish
.docker-job-definition: &docker-job-template
image: docker:stable
......@@ -95,16 +96,6 @@ unit_test:frontend:
dependencies:
- build:frontend
bundle:docker:
<<: *docker-build-template
stage: bundle
variables:
BUILD_ARGS: --build-arg BASE=${CI_REGISTRY}/${CI_PROJECT_PATH}/backend --file ./docker/nightly.Dockerfile
IMAGE_NAME: kegtap
dependencies:
- build:frontend
- build:backend
pages:
image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/backend-dev"
stage: docs
......@@ -120,3 +111,35 @@ pages:
artifacts:
paths:
- public
bundle:docker:
<<: *docker-build-template
stage: bundle
variables:
BUILD_ARGS: --build-arg BASE=${CI_REGISTRY}/${CI_PROJECT_PATH}/backend --file ./docker/nightly.Dockerfile
IMAGE_NAME: kegtap
only:
- master
dependencies:
- build:frontend
- build:backend
publish:docker-nightly:
<<: *docker-job-template
environment:
name: Docker Hub Nightly
url: https://hub.docker.com/r/mittelab/kegtap
stage: publish
script:
- export FROM_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/${FROM_IMAGE_NAME}"
- export TO_IMAGE="${HUB_USER}/${TO_IMAGE_NAME}"
- docker pull "${FROM_IMAGE}"
- docker logout
- docker login -u "${HUB_USER}" -p "${HUB_ACCESS_TOKEN}"
- docker tag "${FROM_IMAGE}" "${TO_IMAGE}"
- docker push "${TO_IMAGE}"
variables:
FROM_IMAGE_NAME: kegtap:latest
TO_IMAGE_NAME: kegtap:nightly
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