-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
121 lines (115 loc) · 3.28 KB
/
.gitlab-ci.yml
1
2
3
4
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
stages:
- build
- deploy
build-frontend:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
before_script:
- cp schema.prisma _frontend/
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- /kaniko/executor
--context "${CI_PROJECT_DIR}/_frontend"
--dockerfile "${CI_PROJECT_DIR}/_frontend/Dockerfile"
--destination "cr.hera.lan/stash:${tag}"
--skip-tls-verify-registry "cr.hera.lan"
--cache=true
--cache-run-layers
--cache-copy-layers
only:
changes:
- _frontend/**/*
- schema.prisma
build-worker:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
before_script:
- cp schema.prisma _worker/
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- /kaniko/executor
--context "${CI_PROJECT_DIR}/_worker"
--dockerfile "${CI_PROJECT_DIR}/_worker/Dockerfile"
--destination "cr.hera.lan/stash-worker:${tag}"
--skip-tls-verify-registry "cr.hera.lan"
--cache=true
--cache-run-layers
--cache-copy-layers
only:
changes:
- _worker/**/*
- schema.prisma
build-gatekeeper:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- /kaniko/executor
--context "${CI_PROJECT_DIR}/_gatekeeper"
--dockerfile "${CI_PROJECT_DIR}/_gatekeeper/Dockerfile"
--destination "cr.hera.lan/stash-gatekeeper:${tag}"
--skip-tls-verify-registry "cr.hera.lan"
--cache=true
--cache-run-layers
--cache-copy-layers
only:
changes:
- _gatekeeper/**/*
- schema.prisma
build-symlinker:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- /kaniko/executor
--context "${CI_PROJECT_DIR}/_symlinker"
--dockerfile "${CI_PROJECT_DIR}/_symlinker/Dockerfile"
--destination "cr.hera.lan/stash-symlinker:${tag}"
--skip-tls-verify-registry "cr.hera.lan"
--cache=true
--cache-run-layers
--cache-copy-layers
only:
changes:
- _symlinker/**/*
deploy:
stage: deploy
image: busybox:latest
script:
- wget --post-data="" $HOOK_URL > /dev/null 2>&1