-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
175 lines (159 loc) · 3.53 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
include:
- project: foundation/templates/ci-template
file: backend-ci.yml
inputs:
branch: develop
- project: foundation/templates/ci-template
file: update-manifest.yml
# stages:
# - test
# - build
# - dockerize
# # - deploy
# ##### cache template
# cache:
# - &global_cache_node_mods
# key:
# files:
# - pnpm-lock.yaml
# paths:
# - apps/server/node_modules/
# - apps/web/node_modules/
# - out/
# policy: pull # prevent subsequent jobs from modifying cache
# ##### Test template
# .test_template: &test
# stage: test
# image: $RUNNER_IMAGE
# script:
# - sh ./scripts/test.sh
# cache:
# - <<: *global_cache_node_mods
# tags:
# - vm-docker
# allow_failure: false
# when: on_success
# ##### Build template
# .build_template: &build
# stage: build
# image: $RUNNER_IMAGE
# cache:
# - <<: *global_cache_node_mods
# script:
# - sh ./scripts/build.sh
# tags:
# - vm-docker
# allow_failure: false
# when: on_success
# artifacts:
# paths:
# - apps/$BUILD_DIR/artifacts.zip
# expire_in: 1 day
# ##### Dockerize template
# .dockerize_template: &dockerize
# stage: dockerize
# image: $KANIKO_RUNNER_IMAGE
# script:
# - sh ./scripts/dockerize.sh
# cache:
# - <<: *global_cache_node_mods
# tags:
# - vm-docker
# allow_failure: false
# when: on_success
# ##### node_module install step
# ## Stage: .pre
# ######
# install:
# image: $RUNNER_IMAGE
# stage: .pre # always first
# cache:
# # Mimic &global_cache_node_mods config but override policy
# # to allow this job to update the cache at the end of the job
# # and only update if it was a successful job (#5)
# - <<: *global_cache_node_mods
# when: on_success
# policy: pull-push
# script:
# # - nvm use
# - pnpm install
# - turbo prune server --docker
# tags:
# - vm-docker
# rules: #add this to bypass merge requests
# - if: '$CI_PIPELINE_SOURCE =~ /.*/'
# # unit-test:
# # <<: *test
# # rules:
# # - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# # build-mr:
# # <<: *build
# # # image: node with zip
# # rules:
# # - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# # needs:
# # - unit-test
# build:be:
# <<: *build
# variables:
# BUILD_DIR: server
# when: manual
# only: # update this for staging
# - dev
# - develop
# build:fe:
# <<: *build
# variables:
# BUILD_DIR: web
# when: manual
# only: # update this for staging
# - dev
# - develop
# dockerize:be:
# <<: *dockerize
# variables:
# REGISTRY: $REGISTRY_BE
# DOCKERFILE_DIR: apps/server
# only: # update this for staging
# - dev
# - develop
# needs:
# - job: build:be
# artifacts: true
# dockerize:fe:
# <<: *dockerize
# variables:
# REGISTRY: $REGISTRY_FE
# DOCKERFILE_DIR: apps/web
# only: # update this for staging
# - dev
# - develop
# needs:
# - job: build:fe
# artifacts: true
stages:
- dockerize
##### Dockerize template
.dockerize_template: &dockerize
stage: dockerize
image: $KANIKO_RUNNER_IMAGE
script:
- sh ./scripts/dockerize.sh
tags:
- vm-docker
allow_failure: false
when: on_success
dockerize:be:
<<: *dockerize
variables:
REGISTRY: $REGISTRY_BE
DOCKERFILE_DIR: apps/server
only: # update this for staging
- develop
dockerize:fe:
<<: *dockerize
variables:
REGISTRY: $REGISTRY_FE
DOCKERFILE_DIR: apps/web
only: # update this for staging
- develop