-
Notifications
You must be signed in to change notification settings - Fork 3
/
bitbucket-pipelines.yml
49 lines (47 loc) · 1.52 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
image: node:20.11.1
definitions:
services:
docker:
memory: 6000
caches:
sonar: ~/.sonar/cache
steps:
- step: &lint-test-build
name: Lint, tests and build
caches:
- node
- sonar
- docker # used by sonar pipes
size: 2x # more memory to accomodate docker container for sonarcloud
script:
- npm ci
- npm run ci:lint-format
- npm run coverage
- npm run audit
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
SONAR_SCANNER_OPTS: -Xmx4G
- pipe: sonarsource/sonarcloud-quality-gate:0.1.6
- npm run build
artifacts:
- dist/**
pipelines:
pull-requests:
"**":
- step: *lint-test-build
- step:
# actually publishing should be only possible on the master branch, but see
# https://community.atlassian.com/t5/Bitbucket-questions/bitbucket-pipeline-user-permissions-to-write-to-master/qaq-p/1177712
name: "publish patch version to npm"
trigger: manual
deployment: production
size: 2x # TODO figure out how to reduce this back to 1, if possible, needed because of global docker memory assignment
script:
- npm version patch -m "Bump version to %s [skip ci]"
- git push && git push --tags
- pipe: atlassian/npm-publish:0.2.0
variables:
NPM_TOKEN: $NPM_TOKEN
branches:
master:
- step: *lint-test-build