-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
59 lines (55 loc) · 1.22 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
stages:
- test
- deploy
# Lint js files
lint-js:
image: node
stage: test
tags:
- docker
script:
- npm install -g eslint
- eslint --ignore-pattern "**/*.min.js" $CI_PROJECT_DIR
# Performs unit testing
unit-test:
coverage: '/Statements\s*:\s*(\d+(?:\.\d+)?\%)/'
image: registry.gitlab.com/gcsboss/docker-mocha-nyc:0.1.0-alpine
stage: test
artifacts:
paths: [coverage]
tags:
- docker
script:
- npm i --no-optional .
- npm run-script coverage
# Analyse code quality
code_quality:
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality" /code
artifacts:
paths: [gl-code-quality-report.json]
# Publish package to NPM
publish:
stage: deploy
image: node
tags:
- docker
only:
- tags
- triggers
script:
- npm install -g npm-cli-login
- npm-cli-login
- npm publish