-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
112 lines (100 loc) · 2.36 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
image: node:14
cache:
key: "$CI_BUILD_REF_NAME"
paths:
- node_modules
- .yarn-cache
- .scannerwork
- /root/.sonar
stages:
- install
- test
- analysis
- release
- update
before_script:
- export CI=true
- export GH_REPO=https://${GH_TOKEN}:[email protected]/d0whc3r/node-gdrive
after_script:
- rm -fr .npmrc
install-deps:
stage: install
script:
- yarn install --cache-folder .yarn-cache
- yarn build
tests:
stage: test
before_script:
- mkdir -p secrets
after_script:
- rm -fr secrets
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=./
semantic-release:
stage: release
only:
- master
script:
- yarn semantic-release
update-patch:
stage: update
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 ${CI_COMMIT_REF_NAME}
- yarn build
- yarn version --patch
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish
update-minor:
stage: update
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 ${CI_COMMIT_REF_NAME}
- yarn build
- yarn version --minor
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish
update-major:
stage: update
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 ${CI_COMMIT_REF_NAME}
- yarn build
- yarn version --major
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish