-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbitbucket-pipelines.yml
58 lines (55 loc) · 1.92 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
image: node:20.15.0
options:
max-time: 30
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:
- cd org.knime.scripting.editor.js
- npm ci
- npm run type-check
- npm run ci:lint-format
- npm run coverage
- npm run audit
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
SONAR_SCANNER_OPTS: -Xmx4G
- npm run build
artifacts:
- org.knime.scripting.editor.js/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:
- cd org.knime.scripting.editor.js
- npm version patch --no-git-tag-version
- version=`node -p "require('./package.json').version"`
- git add package.json package-lock.json
- git commit -m "Bump version to ${version} [skip ci]" --no-verify
- git tag "v${version}" -am "Bump version to ${version}"
- git push --no-verify && git push --tags --no-verify
- pipe: atlassian/npm-publish:0.2.0
variables:
NPM_TOKEN: $NPM_TOKEN
branches:
"{master,releases/*}":
- step: *lint-test-build