-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
100 lines (94 loc) · 2.13 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Sample pipelines for a NX Repository with pnpm as package manager
image: node:lts
clone:
depth: full
definitions:
caches:
pnpm:
key:
files:
- pnpm-lock.yaml
path: $BITBUCKET_CLONE_DIR/.pnpm-store
node:
key:
files:
- pnpm-lock.yaml
path: node_modules
cypress: $HOME/.cache/Cypress
sonar: $HOME/.sonar/cache
coverage: ./coverage
shared:
- &pnpm-activate >-
corepack enable
&& corepack prepare pnpm@latest-7 --activate
services:
docker:
memory: 2560
steps:
- step: &pnpm
name: Install dependencies
caches:
- node
- cypress
- pnpm
script:
- *pnpm-activate
- pnpm install --shamefully-hoist
- step: &lint
name: Execute lint check
caches:
- node
- pnpm
script:
- npx nx run-many --all --target=lint
- step: &build
name: Build
caches:
- node
- pnpm
script:
- *pnpm-activate
- pnpm exec nx build backoffice
- pnpm exec nx build diary
artifacts:
- dist/apps/**
- step: &sonarcloud
name: Run SonarCloud
services:
- docker
caches:
- node
- pnpm
- sonar
- coverage
- docker
script:
- pipe: sonarsource/sonarcloud-scan:1.4.0
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
- step: &deploy
name: Deploy Backoffice
caches:
- node
- pnpm
script:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- npm install -g @aws-amplify/cli
- cd apps/backoffice
- sh amplify/pipelines-pull.sh
- amplify publish -y
pipelines:
pull-requests:
"**":
- step: *pnpm
- step: *lint
- step: *build
- step: *sonarcloud
branches:
main:
- step: *pnpm
- step: *lint
- step: *build
- step: *sonarcloud
- step: *deploy