forked from d0whc3r/vue-auth-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
114 lines (103 loc) · 2.54 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
image: node:10
cache:
key: "$CI_BUILD_REF_NAME"
paths:
- node_modules
- demo/node_modules
- .yarn-cache
- .scannerwork
- /root/.sonar
stages:
- install
- test
- analysis
- docs
- publish
before_script:
- export GH_REPO=https://${GH_TOKEN}:x-oauth-basic@github.com/d0whc3r/vue-auth-plugin
install-deps:
stage: install
script:
- yarn install --cache-folder .yarn-cache
- cd demo && yarn install --cache-folder ../.yarn-cache
- yarn build
tests:
stage: test
script:
- yarn test:coverage
- yarn test:send-coverages
coverage: '/All files\s*\|\s*([\d.]+)/'
artifacts:
paths:
- coverage
expire_in: 30 days
sonarqube-reports-master:
stage: analysis
image: timbru31/java-node
only:
- master
script:
- yarn sonar-scanner -Dsonar.login=${SONAR_TOKEN} -Duser.home=./
sonarqube-reports-branch:
stage: analysis
image: timbru31/java-node
except:
- master
script:
- yarn sonar-scanner -Dsonar.login=${SONAR_TOKEN} -Dsonar.branch.name=${CI_BUILD_REF_NAME} -Dsonar.branch.target=master -Duser.home=./
documentation:
stage: docs
only:
- master
script:
- yarn docs:build
- git config --global user.email "ghpages@gitlab"
- git config --global user.name "Gitlab CI"
- yarn gh-pages -d docs/.vuepress/dist -r ${GH_REPO}
- mv docs/.vuepress/dist/ public/
artifacts:
paths:
- public
expire_in: 30 days
publish-npm-patch:
stage: publish
when: manual
only:
- master
script:
- git config --global user.email "ghpages@gitlab"
- git config --global user.name "Gitlab CI"
- git remote set-url origin ${GH_REPO}
- git checkout master
- yarn version --patch
- yarn build
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish
publish-npm-minor:
stage: publish
when: manual
only:
- master
script:
- git config --global user.email "ghpages@gitlab"
- git config --global user.name "Gitlab CI"
- git remote set-url origin ${GH_REPO}
- git checkout master
- yarn version --minor
- yarn build
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish
publish-npm-major:
stage: publish
when: manual
only:
- master
script:
- git config --global user.email "ghpages@gitlab"
- git config --global user.name "Gitlab CI"
- git remote set-url origin ${GH_REPO}
- git checkout master
- yarn version --major
- yarn build
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish