1
0
mirror of https://gitlab.com/openlp/runners.git synced 2024-12-22 11:22:48 +00:00
runners/.gitlab-ci.yml

192 lines
6.0 KiB
YAML
Raw Normal View History

image: docker:stable
2024-02-14 06:09:08 +00:00
stages:
- test
- build
services:
- docker:dind
variables:
IMAGE_BASE: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
lint-dockerfiles:
2024-02-14 06:09:08 +00:00
stage: test
image: hadolint/hadolint:latest-alpine
before_script:
- ''
script:
- hadolint --failure-threshold error Dockerfile.*
2024-04-27 19:50:57 +00:00
rules:
- when: always
2024-02-14 06:09:08 +00:00
test-pypi:
stage: test
script:
- docker pull $IMAGE_BASE/pypi || true
- docker build --cache-from $IMAGE_BASE/pypi --tag $IMAGE_BASE/pypi:$CI_COMMIT_SHA --tag $IMAGE_BASE/pypi:latest -f Dockerfile.pypi .
rules:
- if: $CI_COMMIT_BRANCH != "master"
changes:
- Dockerfile.pypi
2024-02-14 06:09:08 +00:00
test-debian:
stage: test
script:
- docker pull $IMAGE_BASE/debian || true
- docker build --cache-from $IMAGE_BASE/debian --tag $IMAGE_BASE/debian:$CI_COMMIT_SHA --tag $IMAGE_BASE/debian:latest -f Dockerfile.debian .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.debian
test-ubuntu:
stage: test
script:
- docker pull $IMAGE_BASE/ubuntu || true
- docker build --cache-from $IMAGE_BASE/ubuntu --tag $IMAGE_BASE/ubuntu:$CI_COMMIT_SHA --tag $IMAGE_BASE/ubuntu:latest -f Dockerfile.ubuntu .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.ubuntu
test-fedora:
stage: test
script:
- docker pull $IMAGE_BASE/fedora || true
- docker build --cache-from $IMAGE_BASE/fedora --tag $IMAGE_BASE/fedora:$CI_COMMIT_SHA --tag $IMAGE_BASE/fedora:latest -f Dockerfile.fedora .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.fedora
test-arch:
stage: test
script:
- docker pull $IMAGE_BASE/arch || true
- docker build --cache-from $IMAGE_BASE/arch --tag $IMAGE_BASE/arch:$CI_COMMIT_SHA --tag $IMAGE_BASE/arch:latest -f Dockerfile.arch .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.arch
test-angular:
stage: test
script:
- docker pull $IMAGE_BASE/angular || true
- docker build --cache-from $IMAGE_BASE/angular --tag $IMAGE_BASE/angular:$CI_COMMIT_SHA --tag $IMAGE_BASE/angular:latest -f Dockerfile.angular .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.angular
test-documentation:
stage: test
script:
- docker pull $IMAGE_BASE/documentation || true
- docker build --cache-from $IMAGE_BASE/documentation --tag $IMAGE_BASE/documentation:$CI_COMMIT_SHA --tag $IMAGE_BASE/documentation:latest -f Dockerfile.documentation .
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH != "master"
2024-02-14 06:09:08 +00:00
changes:
- Dockerfile.documentation
build-pypi:
stage: build
script:
- docker pull $IMAGE_BASE/pypi || true
- docker build --cache-from $IMAGE_BASE/pypi --tag $IMAGE_BASE/pypi:$CI_COMMIT_SHA --tag $IMAGE_BASE/pypi:latest -f Dockerfile.pypi .
- docker push $IMAGE_BASE/pypi:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/pypi:latest
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- Dockerfile.pypi
build-debian:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/debian || true
- docker build --cache-from $IMAGE_BASE/debian --tag $IMAGE_BASE/debian:$CI_COMMIT_SHA --tag $IMAGE_BASE/debian:latest -f Dockerfile.debian .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/debian:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/debian:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.debian
build-ubuntu:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/ubuntu || true
- docker build --cache-from $IMAGE_BASE/ubuntu --tag $IMAGE_BASE/ubuntu:$CI_COMMIT_SHA --tag $IMAGE_BASE/ubuntu:latest -f Dockerfile.ubuntu .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/ubuntu:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/ubuntu:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.ubuntu
build-fedora:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/fedora || true
- docker build --cache-from $IMAGE_BASE/fedora --tag $IMAGE_BASE/fedora:$CI_COMMIT_SHA --tag $IMAGE_BASE/fedora:latest -f Dockerfile.fedora .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/fedora:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/fedora:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.fedora
build-arch:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/arch || true
- docker build --cache-from $IMAGE_BASE/arch --tag $IMAGE_BASE/arch:$CI_COMMIT_SHA --tag $IMAGE_BASE/arch:latest -f Dockerfile.arch .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/arch:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/arch:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.arch
build-angular:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/angular || true
- docker build --cache-from $IMAGE_BASE/angular --tag $IMAGE_BASE/angular:$CI_COMMIT_SHA --tag $IMAGE_BASE/angular:latest -f Dockerfile.angular .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/angular:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/angular:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.angular
build-documentation:
stage: build
script:
2023-03-16 04:54:21 +00:00
- docker pull $IMAGE_BASE/documentation || true
- docker build --cache-from $IMAGE_BASE/documentation --tag $IMAGE_BASE/documentation:$CI_COMMIT_SHA --tag $IMAGE_BASE/documentation:latest -f Dockerfile.documentation .
2023-03-16 04:54:21 +00:00
- docker push $IMAGE_BASE/documentation:$CI_COMMIT_SHA
- docker push $IMAGE_BASE/documentation:latest
2024-02-14 15:08:19 +00:00
rules:
2024-04-27 19:50:57 +00:00
- if: $CI_COMMIT_BRANCH == "master"
2024-02-14 15:08:19 +00:00
changes:
- Dockerfile.documentation
2023-05-18 16:19:07 +00:00
build-all:
stage: build
script:
- |
for NAME in debian ubuntu fedora arch angular documentation; do
docker pull $IMAGE_BASE/$NAME || true
docker build --cache-from $IMAGE_BASE/$NAME --tag $IMAGE_BASE/$NAME:$CI_COMMIT_SHA --tag $IMAGE_BASE/$NAME:latest -f Dockerfile.$NAME .
docker push $IMAGE_BASE/$NAME:$CI_COMMIT_SHA
docker push $IMAGE_BASE/$NAME:latest
done
2024-04-27 19:50:57 +00:00
rules:
- when: manual