This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·112 lines (99 loc) · 2.94 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
# BEGIN job-specific configuration
default:
cache:
key: "${CI_PROJECT_PATH_SLUG}"
paths:
- ".yarn"
- "node_modules"
- "yarn-packages-offline-cache"
image: "node:12.18.3"
.default-rule: &default-rule
only:
- "merge-requests"
.build: &build
extends:
- ".default-rule"
script:
- "yarn install --cache .yarn --prefer-offline"
- "node_modules/.bin/nest build $MODULE_NAME"
stage: "build"
when: "manual"
.test: &test
artifacts:
when: "always"
paths:
- "coverage"
expire_in: "7 days"
extends:
- ".default-rule"
script:
- "yarn install --cache .yarn --prefer-offline"
- "node_modules/.bin/jest --ci --config ./jest.config.json --coverage $MODULE_NAME_TEST"
stage: "test"
when: "manual"
.coverage: &coverage
artifacts:
expire_in: "7 days"
paths:
- "public/$MODULE_NAME"
extends:
- ".default-rule"
script:
- "rm -rf public/$MODULE_NAME/*"
- "mkdir -p public/$MODULE_NAME"
- "cp -r coverage/lcov-report/* public/$MODULE_NAME/"
stage: "coverage"
when: "manual"
.dockerization: &dockerization
extends:
- ".default-rule"
image: "docker:19.03.12"
script:
- "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
- "docker pull $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest || true"
- "docker build --cache-from $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest -f $DOCKERFILE --tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest ."
- "docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA"
- "docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest"
# - "docker run -v '$MOUNT_POINT:/mnt' $IMAGE_NAME /mnt/script/to/run/tests"
services:
- "docker:19.03.12-dind"
stage: "dockerization"
variables:
DOCKER_DRIVER: "overlay2"
DOCKER_HOST: "tcp://localhost:2375"
DOCKER_TLS_CERTDIR: ""
# MOUNT_POINT: "$CI_PROJECT_DIR/mnt"
when: "manual"
# END job-specific configuration
# BEGIN project-specific configuration
# END project-specific configuration
# BEGIN actual pipeline definition
stages:
- "build"
- "test"
- "coverage"
- "dockerization"
include:
- local: "/apps/action/.gitlab-ci.yml"
- local: "/apps/album/.gitlab-ci.yml"
- local: "/apps/artist/.gitlab-ci.yml"
- local: "/apps/at/.gitlab-ci.yml"
- local: "/apps/const/.gitlab-ci.yml"
- local: "/apps/download/.gitlab-ci.yml"
- local: "/apps/emotion/.gitlab-ci.yml"
- local: "/apps/file/.gitlab-ci.yml"
- local: "/apps/jwks/.gitlab-ci.yml"
- local: "/apps/melo-api/.gitlab-ci.yml"
- local: "/apps/playlist/.gitlab-ci.yml"
- local: "/apps/relation/.gitlab-ci.yml"
- local: "/apps/rt/.gitlab-ci.yml"
- local: "/apps/search/.gitlab-ci.yml"
- local: "/apps/song/.gitlab-ci.yml"
- local: "/apps/tag/.gitlab-ci.yml"
- local: "/apps/user/.gitlab-ci.yml"
- local: "/libs/apm/.gitlab-ci.yml"
- local: "/libs/common/.gitlab-ci.yml"
- local: "/libs/dgraph/.gitlab-ci.yml"
- local: "/libs/prom/.gitlab-ci.yml"
- local: "/libs/sentry/.gitlab-ci.yml"
# END actual pipeline definition