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

CI improvements.

- Notify on scheduled pipeline failures.
- Seperate the IMAGE and CONTEXT variables. Allow building where the 2
don't match (planning for httpd/buster and httpd/bullseye).
parent c3f03905
Branches
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
include: include:
- project: shore/ci-templates - project: shore/ci-templates
file: templates/pre-commit.yml file: templates/pre-commit.yml
- project: shore/ci-templates
file: templates/notify.yml
stages: stages:
- test - test
...@@ -14,6 +16,7 @@ stages: ...@@ -14,6 +16,7 @@ stages:
# hard-coded to latest. # hard-coded to latest.
variables: variables:
TAG: latest TAG: latest
CONTEXT: "$IMAGE"
# Job templates: # Job templates:
...@@ -23,7 +26,7 @@ variables: ...@@ -23,7 +26,7 @@ variables:
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
tags: &tags [ns4.shore.co.il] tags: &tags [ns4.shore.co.il]
script: script:
- docker build --pull --no-cache --iidfile iid "$IMAGE" - docker build --pull --no-cache --iidfile iid "$CONTEXT"
after_script: after_script:
- echo "HASH=$(cat iid)" > dot.env - echo "HASH=$(cat iid)" > dot.env
artifacts: artifacts:
...@@ -33,8 +36,8 @@ variables: ...@@ -33,8 +36,8 @@ variables:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "push" - if: $CI_PIPELINE_SOURCE == "push"
changes: changes:
- $IMAGE/* - $CONTEXT/*
- $IMAGE/**/* - $CONTEXT/**/*
.push: .push:
stage: deploy stage: deploy
...@@ -49,7 +52,7 @@ variables: ...@@ -49,7 +52,7 @@ variables:
build-cgit: build-cgit:
extends: .build extends: .build
variables: variables:
IMAGE: cgit CONTEXT: cgit
push-cgit: push-cgit:
extends: .push extends: .push
...@@ -64,7 +67,7 @@ push-cgit: ...@@ -64,7 +67,7 @@ push-cgit:
build-httpd: build-httpd:
extends: .build extends: .build
variables: variables:
IMAGE: httpd CONTEXT: httpd
push-httpd: push-httpd:
extends: .push extends: .push
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment