-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (63 loc) · 1.3 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
stages:
- build
- lint
- test
services:
- postgres:12.2-alpine
variables:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_HOST_AUTH_METHOD: trust
RULES_CHANGES_PATH: "**/*"
.base-rules:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: '$CI_PIPELINE_SOURCE == "push"'
when: never
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- $RULES_CHANGES_PATH
- when: manual
allow_failure: true
.api:
extends: .base-rules
variables:
RULES_CHANGES_PATH: "api/**/*"
api-build:
tags:
- node
stage: build
extends: .api
needs: []
before_script:
- cd api
- npm install
script:
- npm run build
api-lint:
tags:
- node
stage: lint
extends: .api
needs: ["api-build"]
before_script:
- cd api
- npm install
script:
- npm run lint
api-test:
tags:
- node
stage: test
extends: .api
before_script:
- cd api
- npm install
- npm run db:migrate
needs: ["api-build"]
script:
- npm run test