-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
139 lines (126 loc) · 3.75 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
# vim: syntax=yaml textwidth=120 expandtab tabstop=2 softtabstop=2 shiftwidth=2 autoindent
stages:
- prepare
- linters
- build
- test
- deploy
.cache-tpl: &cache-tpl
key: "$CI_COMMIT_REF_SLUG"
paths:
- node_modules
policy: pull
.build-tpl: &build-tpl
# we need to use this specific version of node
# otherwise you will get the following error during the tests:
# TypeError: Cannot assign to read only property
image: node:11.10.1
tags:
- docker
cache:
<<: *cache-tpl
.test-tpl: &test-tpl
<<: *build-tpl
except:
variables:
- $SKIP_TESTS
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
prepare:
<<: *build-tpl
stage: prepare
cache:
<<: *cache-tpl
policy: pull-push
script:
- npm install
except:
variables:
- $SKIP_PREPARE
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
linters:
<<: *build-tpl
stage: linters
script:
- npm run lint
except:
variables:
- $SKIP_LINTERS
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
check_author:
image: docker-registry.linagora.com:5000/lgs-releases/gitlab-integrity-checks:latest
stage: prepare
variables:
GIT_DEPTH: "1"
tags:
- ultralight
script:
- check_author.py check "$GITLAB_USER_EMAIL" "$GITLAB_USER_NAME" --no-accents
except:
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
build:
<<: *build-tpl
stage: build
script:
- npm run build
except:
variables:
- $SKIP_BUILD
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
test_unit:
<<: *test-tpl
stage: test
script:
- npm run test:unit
# can reuse cache. issue with cypress.
test_e2e:
image: cypress/base:10
stage: test
tags:
- docker
except:
variables:
- $SKIP_TESTS
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- tags@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^release-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
script:
- npm install
- npm run test:e2e -- --headless
deploy-snapshot:
image: docker-registry.linagora.com:5000/linshare-releases/linshare-build-helper:latest
stage: deploy
tags:
- docker
script:
- mvn -P hard-clean clean package deploy
- CHANNEL=snapshots
- VERSION=$(mvn -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -q)
- curl -s -X POST
-F "token=${BUILD_DOCKER_IMAGE_TOKEN}"
-F "ref=${CI_COMMIT_REF_NAME}"
-F "variables[VERSION]=${VERSION}"
-F "variables[CHANNEL]=${CHANNEL}"
https://ci.linagora.com/api/v4/projects/1755/trigger/pipeline
except:
variables:
- $SKIP_DEPLOY
only:
refs:
- master@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice
- /^maintenance-.*/@linagora/lgs/linshare/products/linshare-ui-editor-onlyoffice