Commit ad6ff347 authored by Sebastian Schwarz's avatar Sebastian Schwarz
Browse files

Push docker image to Gitlab CI registry.

parent 64d9e09a
Pipeline #490273 failed with stages
in 62 minutes and 58 seconds
variables:
GIT_STRATEGY: fetch
DOCKER_FILE: ${CI_PROJECT_DIR}/gitlab-utils/Dockerfile
DOCKER_IMAGE_DEV: pycity_scheduling_ci
DOCKER_TAG: latest
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
stages:
......@@ -12,21 +13,21 @@ stages:
prepare:
variables:
GIT_SUBMODULE_STRATEGY: none
stage: build
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- mkdir -p /.docker
- docker build
--file ${DOCKER_FILE}
--tag ${DOCKER_IMAGE_DEV}-base-image /.docker
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} /.docker
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
tags:
- docker
test-prerequisites:
stage: test
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- python3.6 -m pytest -q /opt/richardsonpy/.
- python3.6 -m pytest -q /opt/pycity_base/.
......@@ -36,7 +37,7 @@ test-prerequisites:
unittest:
stage: test
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
- ln -s $CI_PROJECT_DIR/README.md $CI_PROJECT_DIR/src/README.md
......@@ -48,7 +49,7 @@ unittest:
lint:
stage: test
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- mkdir -p lint
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......@@ -71,7 +72,7 @@ doc:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_TAG =~ /^v/'
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- mkdir -p doc
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......@@ -93,7 +94,7 @@ pages:
- if: '$CI_COMMIT_TAG =~ /^v/'
when: delayed
start_in: '60 minutes'
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- mkdir -p public
- mv $CI_PROJECT_DIR/docs/* public
......@@ -110,7 +111,7 @@ pypi-release:
- if: '$CI_COMMIT_TAG =~ /^v/'
when: delayed
start_in: '120 minutes'
image: ${DOCKER_IMAGE_DEV}-base-image
image: ${DOCKER_IMAGE}
script:
- mkdir -p release
- ln -s $CI_PROJECT_DIR/LICENSE.txt $CI_PROJECT_DIR/src/LICENSE.txt
......@@ -127,4 +128,3 @@ pypi-release:
- release
tags:
- docker
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