forked from linagora/linagora.esn.admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
80 lines (74 loc) · 1.6 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
image: linagora/node-test-base:8
stages:
- test
- swagger
- deploy-swagger
- deploy_dev
- release
test:
stage: test
except:
- triggers
tags:
- docker
script:
- npm i
- bower i --allow-root
- grunt --chunk=1 --ci
swagger:
stage: swagger
tags:
- docker
script:
- npm i
- npm prune
- grunt swagger-generate
artifacts:
paths:
- ./doc/REST_API/swagger/admin-swagger.json
deploy-swagger:
stage: deploy-swagger
tags:
- deployment
- api.open-paas.org
- shell
environment:
name: api
url: https://api.open-paas.org
only:
- master@linagora/lgs/openpaas/linagora.esn.admin
script:
- perl -i -pe's/"host":"localhost:8080"/"schemes":["https"],"host":"demo.open-paas.org"/' ./doc/REST_API/swagger/admin-swagger.json
- cp ./doc/REST_API/swagger/admin-swagger.json /var/www/html
deploy_dev:
stage: deploy_dev
except:
- triggers
tags:
- dev.open-paas.org
- deployment
environment:
name: dev
url: https://dev.open-paas.org
only:
- master@linagora/lgs/openpaas/linagora.esn.admin
script:
- cd /srv/${CI_PROJECT_NAME}
- git fetch --all
- git checkout ${CI_COMMIT_SHA}
- npm install --ignore-scripts --production
- npm update --production
- npm prune
- bower install --production
- bower prune
- git checkout -- .
- sudo /etc/init.d/rse.dev restart
release:
stage: release
only:
- triggers
script:
- if [ -z "${VERSION}" ]; then exit 1; fi
- npm i
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- grunt release:${VERSION}