Skip to content
Snippets Groups Projects
Commit 9998c489 authored by nimrod's avatar nimrod
Browse files

Refactor .gitlab-ci.yml.

Can't use the "host" variable as the tag. Workaround that with YAML
anchors (ugly but works).
parent 2f93d72f
No related branches found
No related tags found
No related merge requests found
Pipeline #192 passed with warnings
......@@ -20,35 +20,41 @@ pre-commit:
paths:
- .cache/
build:
build-host01:
stage: build
tags:
- "$host"
variables:
- host01.shore.co.il
variables: &build_vars
COMPOSE_DOCKER_CLI_BUILD: "1"
DOCKER_BUILDKIT: "1"
script:
script: &build_script
- docker-compose build --no-cache --pull
- docker-compose pull --quiet
parallel: &parallel
matrix:
- host:
- host01.shore.co.il
build-kodi:
stage: build
tags:
- kodi.shore.co.il
REGISTER_RUN_UNTAGGED: "false"
- host:
variables: *build_vars
script: *build_script
build-ns4:
stage: build
tags:
- ns4.shore.co.il
REGISTER_RUN_UNTAGGED: "true"
variables: *build_vars
script: *build_script
run:
run-host01:
stage: run
tags:
- $host
- host01.shore.co.il
variables:
RUNNER_NAME: "$host"
RUNNER_TAG_LIST: "$host"
RUNNER_NAME: host01.shore.co.il
RUNNER_TAG_LIST: host01.shore.co.il
REGISTER_RUN_UNTAGGED: "false"
when: manual
script:
script: &run-script
- docker-compose up --detach --remove-orphans
# yamllint disable rule:line-length
- |
......@@ -58,4 +64,25 @@ run:
sleep 10
done
! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$'
parallel: *parallel
run-kodi:
stage: run
tags:
- kodi.shore.co.il
variables:
RUNNER_NAME: kodi.shore.co.il
RUNNER_TAG_LIST: kodi.shore.co.il
REGISTER_RUN_UNTAGGED: "false"
when: manual
script: *run-script
run-ns4:
stage: run
tags:
- ns4.shore.co.il
variables:
RUNNER_NAME: ns4.shore.co.il
RUNNER_TAG_LIST: ns4.shore.co.il
REGISTER_RUN_UNTAGGED: "true"
when: manual
script: *run-script
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment