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

Update file .gitlab-ci.yml

parent 637ec12a
Branches
Tags v1.0.1.rc1
No related merge requests found
Pipeline #1574998 failed
......@@ -8,6 +8,9 @@ scheduler-docker-build:
# Use the official docker image.
image: docker:latest
stage: build
only:
- main
- tags
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
......@@ -19,18 +22,23 @@ scheduler-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=""
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
# Build frontend Docker Container
- mv ./scheduler/.production.env ./scheduler/.env
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}/scheduler" ./scheduler
- docker push "$CI_REGISTRY_IMAGE${tag}/scheduler"
- |
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/scheduler:$tag"
echo "Docker image name is: $image_name"
- mv ./scheduler/.production.env ./scheduler/.env
- docker build --pull -t "$image_name" ./src
- docker push "$image_name"
deploy:
stage: deploy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment