Skip to content
Snippets Groups Projects
Commit 1d485762 authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

Update .gitlab-ci.yml file

parent 8419c1de
No related branches found
Tags v1.0.1.rc8
No related merge requests found
Pipeline #1563503 passed
......@@ -46,21 +46,21 @@ rights-engine-docker-build:
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
elif [[ -n "$CI_COMMIT_TAG" ]]; then
tag="$CI_COMMIT_TAG"
echo "Running on tag '$CI_COMMIT_TAG': tag = $tag"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- image_name="$CI_REGISTRY_IMAGE:rights-engine-$tag"
- echo "Docker image name: $image_name"
- docker build --pull -t "$image_name" ./src
- docker push "$image_name"
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
elif [[ -n "$CI_COMMIT_TAG" ]]; then
tag="$CI_COMMIT_TAG"
echo "Running on tag '$CI_COMMIT_TAG': tag = $tag"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
image_name="$CI_REGISTRY_IMAGE:rights-engine-$tag"
echo "Docker image name is: $image_name"
- docker build --pull -t "$image_name" ./src
- docker push "$image_name"
pages:
image: python:3.8-buster
......
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