-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
114 lines (102 loc) · 2.4 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
include:
- project: 'ExplorViz/code/deployment'
file: '.gitlab-ci-explorviz-common.yml'
default:
tags:
- exec-docker
image: explorviz/build-images:frontend-v20.11.0-debian
cache: # Cache modules in between jobs
key: $CI_COMMIT_REF_SLUG
paths:
- .npm/
stages:
- code-analysis
- test
- build
- deploy:images
- deploy:retagging
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
linting:
stage: code-analysis
before_script:
- node --version
- npm --version
- npm install
script:
- npm run lint
artifacts:
expire_in: 1h
paths:
- node_modules
test:
stage: test
script:
- ember test
.build:
stage: build
variables:
VERSION_TAG: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
script:
- ember build --prod
artifacts:
expire_in: 1h
paths:
- node_modules
- dist
build-prod:
extends:
- .build
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
build-prod-noauth:
extends:
- .build
variables:
VERSION_TAG: $CI_COMMIT_BRANCH-noauth-$CI_COMMIT_SHORT_SHA
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
before_script:
- export AUTH0_ENABLED=false
deploy-prod:
extends:
- .build-and-deploy
dependencies:
- build-prod
variables:
DOCKERHUB_TAG: 'production'
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_BRANCH == "main"'
deploy-dev-noauth:
extends:
- .build-and-deploy
dependencies:
- build-prod-noauth
variables:
DOCKERHUB_TAG: 'dev-noauth'
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_BRANCH == "main"'
deploy-merge-request-auth:
extends:
- .build-and-deploy
dependencies:
- build-prod
variables:
DOCKERHUB_TAG: mr-$CI_MERGE_REQUEST_IID-noauth
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
deploy-merge-request-noauth:
extends:
- .build-and-deploy
dependencies:
- build-prod-noauth
variables:
DOCKERHUB_TAG: mr-$CI_MERGE_REQUEST_IID-noauth
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'