-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
85 lines (76 loc) · 1.81 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
image: node:10
cache:
key: '$CI_BUILD_REF_NAME'
paths:
- node_modules
- code/node_modules
- .yarn-cache
- .scannerwork
- /root/.sonar
stages:
- install
- test
- analysis
# - docs
- publish
before_script:
- export GH_REPO=https://${GH_TOKEN}:[email protected]/d0whc3r/yavnotifier
install-deps:
stage: install
script:
- yarn install --cache-folder .yarn-cache
- yarn build
tests:
stage: test
script:
- yarn test
- yarn test:send-coverages
coverage: '/All files\s*\|\s*([\d.]+)/'
artifacts:
paths:
- report
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:
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 build:packages
- git add .
- "git commit -m 'docs: update documentation\n[skip-ci]'"
- git push
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- yarn publish:packages