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

Add conditional inputs for Docker build configurations

parent 35502d41
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,9 @@ docker-compose-build:
DOCKER_TLS_CERTDIR: ""
DOCKER_REGISTRY: $CI_REGISTRY_IMAGE
DOCKER_IMAGE_TAG: $CI_COMMIT_BRANCH
BUILD_MAIN: $[[ inputs.build_main ]]
BUILD_BRANCH: $[[ inputs.build_branch ]]
BUILD_TAG: $[[ inputs.build_tag ]]
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -43,12 +46,12 @@ docker-compose-build:
- docker compose push
# Run this job in a branch where a docker-compose.yml exists
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $[[ inputs.build_main ]]
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $BUILD_MAIN
exists:
- docker-compose.yml
- if: $CI_COMMIT_BRANCH && $[[ inputs.build_branch ]]
- if: $CI_COMMIT_BRANCH && $BUILD_BRANCH
exists:
- docker-compose.yml
- if: $CI_COMMIT_TAG && $[[ inputs.build_tag ]]
- if: $CI_COMMIT_TAG && $BUILD_TAG
exists:
- docker-compose.yml
\ No newline at end of file
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