-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (69 loc) · 1.68 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
# You can override the included template(s) by including variable overrides
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
cache:
paths:
- package-lock.json
- node_modules/
- dist/
key: "$CI_PIPELINE_ID"
stages:
- build
- test
- lint
- deploy
build:
image: node:alpine
stage: build
script:
- npm install
- npm run build
test:
image: node:alpine
needs:
- build
stage: test
script:
- npm install --no-save mocha-junit-reporter
- npm run test:junit
artifacts:
reports:
junit:
- test-results.xml
lint:
image: node:alpine
needs:
- build
stage: lint
script:
- npm install
- npm run lint:junit
artifacts:
reports:
junit:
- test-lint.xml
deploy:
image: node:alpine
stage: deploy
only:
- tags
needs:
- lint
- test
- build
script:
- |
sed -i "s|\"name\": \"durak\"|\"name\": \"@${CI_PROJECT_NAMESPACE}/durak\"|" package.json
- |
echo "@${CI_PROJECT_NAMESPACE}:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
- npm publish --scope "@${CI_PROJECT_NAMESPACE}"
license_scanning:
needs:
- build
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml