generated from codibre/boilerplate-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
75 lines (70 loc) · 1.82 KB
/
bitbucket-pipelines.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
image: node:10.15.3
clone:
depth: full
options:
size: 2x
definitions:
steps:
- step: &install-packages
name: Install Packages
script:
- printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
- npm install
artifacts:
- node_modules/**
caches:
- node
- step: &build-application
name: Build Application
script:
- npm run build
artifacts:
- dist/**
- step: &validate-lint
name: Validate Lint
script:
- npm run lint
- step: &run-tests
name: Run Tests
script:
- npm run test:coverage
artifacts:
- coverage/**
- step: &scan-code
name: Scan Code
script:
- npm install -g sonarqube-scanner
- sonar-scanner -Dsonar.login=$SONAR_TOKEN
caches:
- sonar-scanner
- step: &publish-package
name: Publish Package
script:
- printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=${NPM_PUBLISH_TOKEN}\n" >> ~/.npmrc
- npm publish
caches:
sonar-scanner: /root/.sonar/native-sonar-scanner
pipelines:
default:
- step: *install-packages
- parallel:
- step: *build-application
- step: *validate-lint
- step: *run-tests
- step: *scan-code
branches:
master:
- step: *install-packages
- parallel:
- step: *build-application
- step: *validate-lint
- step: *run-tests
- step: *scan-code
- step: *publish-package
pull-requests:
'**':
- step: *install-packages
- parallel:
- step: *validate-lint
- step: *run-tests
- step: *scan-code