Skip to content
Snippets Groups Projects
Commit 04a9e216 authored by Sebastian Karius's avatar Sebastian Karius
Browse files

Update docker-compose.yml

parent 07700756
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,14 @@ spec:
type: boolean
default: true
description: "Build a container with the git tag name as container tag."
build_only_protected:
type: boolean
default: false
description: "Build containers only from tags, main branch and protected branches."
docker_compose_file:
type: string
default: "docker-compose.yml"
description: "Path to docker compose file."
---
"$[[ inputs.job-name ]]":
......@@ -35,6 +43,7 @@ spec:
BUILD_MAIN: $[[ inputs.build_main ]]
BUILD_BRANCH: $[[ inputs.build_branch ]]
BUILD_TAG: $[[ inputs.build_tag ]]
BUILD_ONLY_PROTECTED: $[[ inputs.build_only_protected ]]
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -44,14 +53,14 @@ spec:
elif [[ "$CI_COMMIT_TAG" != '' ]]; then
export DOCKER_IMAGE_TAG=$CI_COMMIT_TAG
fi
- docker compose build --pull
- docker compose build --pull -f $[[ inputs.docker_compose_file ]]
- docker compose push
# Run this job in a branch where a docker-compose.yml exists
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $BUILD_MAIN
exists:
- docker-compose.yml
- if: $CI_COMMIT_BRANCH && $BUILD_BRANCH
- if: $CI_COMMIT_BRANCH && $BUILD_BRANCH && $BUILD_ONLY_PROTECTED == false
exists:
- docker-compose.yml
- if: $CI_COMMIT_TAG && $BUILD_TAG
......
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