Newer
Older
---
include:
- project: shore/ci-templates
file: templates/pre-commit.yml
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
stages:
- test
- build
- deploy
# One day I may want to start tagging release and for that the TAG variable is
# needed, but that would mean releasing ALL of the images when tagging (sort of
# a periodic release). The images are not really related so for now TAG is
# hard-coded to latest.
variables:
TAG: latest
.build:
stage: build
variables:
DOCKER_BUILDKIT: "1"
tags: &tags [ns4.shore.co.il]
script:
- docker build --pull --no-cache --iidfile iid "$IMAGE"
after_script:
- echo "HASH=$(cat iid)" > dot.env
artifacts:
reports:
dotenv: dot.env
rules: &rules
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- $IMAGE/*
- $IMAGE/**/*
.push:
stage: deploy
tags: *tags
script:
- docker tag "$HASH" "registry.shore.co.il/$IMAGE:$TAG"
- docker push "registry.shore.co.il/$IMAGE:$TAG"
rules: *rules
build-cgit:
extends: .build
variables:
IMAGE: cgit
push-cgit:
extends: .push
variables:
IMAGE: cgit
needs:
- job: build-cgit
artifacts: true