-
Notifications
You must be signed in to change notification settings - Fork 4
/
bitbucket-pipelines.yml
74 lines (71 loc) · 2.41 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
image: node:20.15.1
options:
max-time: 10
definitions:
services:
docker:
memory: 6000
caches:
sonar: ~/.sonar/cache
pnpm: $BITBUCKET_CLONE_DIR/.pnpm-store
steps:
- step: &lint-test-build
name: Lint, tests and build
caches:
- pnpm
- sonar
- docker # used by sonar pipes
size: 2x # needed for additional memory requirements
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
script:
- corepack enable
- corepack prepare [email protected] --activate # We should use pnpm@latest-9 again when https://github.com/pnpm/pnpm/issues/8788 is resolved
- pnpm install
- pnpm run ci:lint-format
- pnpm run build:ui-extension-service # temporary build step to enable type-check for ui-extension-renderer
- pnpm run type-check
- pnpm run coverage
- pnpm run build:packages
- pnpm run build:demo
- pnpm run audit
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
SONAR_SCANNER_OPTS: -Xmx4G
# - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
artifacts:
- demo/dist/**
- step: &publish-npm
name: Publish packages to npm
caches:
- pnpm
trigger: manual
deployment: production
script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- corepack enable
- corepack prepare [email protected] --activate # We should use pnpm@latest-9 again when https://github.com/pnpm/pnpm/issues/8788 is resolved
- pnpm install
- pnpm run publish
- git push --follow-tags
- step: &deploy-demo
name: Deploy demo to GitHub Pages
caches:
- pnpm
deployment: production
script:
- corepack enable
- corepack prepare pnpm@latest-9 --activate
- pnpm install
# https://support.atlassian.com/bitbucket-cloud/docs/push-back-to-your-repository/#Configuring-an-alternate-Git-client
- git config --global http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/
- pnpm run --filter demo deploy
pipelines:
pull-requests:
"**":
- step: *lint-test-build
- step: *publish-npm
branches:
master:
- step: *lint-test-build
- step: *deploy-demo