Commit 10aa15d9 authored by Matthias's avatar Matthias
Browse files

add files and folders

parent 1039b8b5
Pipeline #10697 failed with stages
in 7 minutes and 32 seconds
variables: # Global definierte Umgebungsvariablen zur Nutzung in einzelnen jobs
DOCKER_TLS_CERTDIR: "" # Notwendig, damit mit Docker Registry kommuniziert werden kann
stages: # Stages sind Gruppen von jobs, welche parallel laufen können
- test
- publish
test:
stage: test
image: python:3.8
before_script:
- pip install pip --upgrade
- pip install -r requirements.txt
script:
- flake8 ./me_test_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
\ 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