2019-09-17 05:03:02 +00:00
|
|
|
image: docker:stable
|
|
|
|
|
2024-02-14 06:09:08 +00:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
|
2019-09-17 05:03:02 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
|
|
|
|
variables:
|
2023-05-18 16:49:41 +00:00
|
|
|
IMAGE_BASE: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
|
2019-09-17 05:03:02 +00:00
|
|
|
|
|
|
|
before_script:
|
2023-05-18 16:49:41 +00:00
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
2019-09-17 05:03:02 +00:00
|
|
|
|
2024-02-14 20:03:23 +00:00
|
|
|
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-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
|
|
|
|
|
2019-09-17 05:03:02 +00:00
|
|
|
build-debian:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/debian || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|
2019-09-17 05:03:02 +00:00
|
|
|
|
|
|
|
build-ubuntu:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/ubuntu || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|
2019-09-17 05:03:02 +00:00
|
|
|
|
|
|
|
build-fedora:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/fedora || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|
2019-10-06 00:26:28 +00:00
|
|
|
|
|
|
|
build-arch:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/arch || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|
2019-10-06 00:26:28 +00:00
|
|
|
|
|
|
|
build-angular:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/angular || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|
2019-10-03 17:49:46 +00:00
|
|
|
|
|
|
|
build-documentation:
|
|
|
|
stage: build
|
|
|
|
script:
|
2023-03-16 04:54:21 +00:00
|
|
|
- docker pull $IMAGE_BASE/documentation || true
|
2023-05-18 16:49:41 +00:00
|
|
|
- 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
|