Skip to content
Snippets Groups Projects
Commit 9173ddeb authored by Paulus Kruger's avatar Paulus Kruger
Browse files

Merge branch 'master' into 'master'

Build docker image in CI and push to registry

See merge request !16
parents d705769f dd449b2c
No related branches found
No related tags found
1 merge request!16Build docker image in CI and push to registry
Pipeline #20841 passed
stages:
- image
docker-build:
stage: image
image: docker:latest
tags:
- privileged
only:
refs:
- master
services:
- docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
FROM ubuntu:20.04
COPY requirements.txt /requirements.txt
RUN apt-get update && apt-get install -y python3 python3-pip python3-yaml git && \
pip3 install -r requirements.txt
WORKDIR ./
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment