-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
87 lines (75 loc) · 1.17 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
image: node:12-alpine
cache:
key: ci-cache-$CI_COMMIT_REF_SLUG
paths:
- node_modules/
before_script:
- apk --no-cache add --virtual builds-deps build-base python
stages:
- build
- test
- buildImage
####
####
#### TEMPLATES
####
####
.base_job:
tags:
- build
####
####
#### BUILD STAGE
####
####
build:
extends: .base_job
stage: build
script:
- yarn install
####
####
#### LINT STAGE
####
####
lint:
extends: .base_job
stage: test
script:
- yarn install
- yarn eslint.check
- yarn prettier.check
cache:
policy: pull
test:
extends: .base_job
stage: test
image: node:12
before_script:
- ''
script:
- yarn install
- cp .env.dist .env
- yarn test
cache:
policy: pull
####
####
#### BUILD IMAGE STAGE
####
####
build_image:
extends: .base_job
stage: buildImage
image: docker:18-dind
services:
- $MATTERS_GLOBAL_DIND_IMAGE
before_script:
- ''
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
only:
- tags
cache: {}