Commit 6ba39bb2 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

Update .gitlab-ci.yml

parent a8207c81
Pipeline #17372 passed with stages
in 1 minute and 56 seconds
variables: # Global definierte Umgebungsvariablen zur Nutzung in einzelnen jobs
DOCKER_TLS_CERTDIR: "" # Notwendig, damit mit Docker Registry kommuniziert werden kann
variables:
DOCKER_TLS_CERTDIR: ""
stages: # Stages sind Gruppen von jobs, welche parallel laufen können
include:
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'docker-image/docker-image.yml'
stages:
- test
- publish
......@@ -13,50 +17,4 @@ test:
- pip install pip --upgrade
- pip install -r requirements.txt
script:
- flake8 ./mediametadatatodb_app
.build-image: # .-Präfix markiert ein job-template
stage: publish
image: docker:stable
services:
- docker:dind
script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" "$REGISTRY"
- docker build --pull -t "$IMAGE_TAG" -f "$DOCKERFILE" .
- docker push "$IMAGE_TAG"
- docker logout
build-tagged-image:
extends: .build-image # Implementiert das job-template .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" # $CI_*-Variablen gehören zu einem set an vordefinierten Variablen
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only: # job wird nur in folgenden Branches verwendet, wobei tags = getaggte commits
- tags
build-latest-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:latest"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only:
- master
build-feature-branch-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
except: # job wird in allen branches ausser den folgenden verwendet
- master
- tags
- flake8 ./mediametadatatodb_app
\ No newline at end of file
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