-
Notifications
You must be signed in to change notification settings - Fork 13
/
bitbucket-pipelines.yml
58 lines (55 loc) · 1.28 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-alpine
definitions:
caches:
sonar: /opt/sonar-scanner/.sonar
steps:
- step: &compile
name: Compile
caches:
- node
script:
- npm ci
- npm run lint
- npm run test-coverage
artifacts:
- coverage/**
- step: &deploy
name: Deploy
trigger: manual
caches:
- node
script:
- npm install
- ./node_modules/.bin/serverless config credentials --provider aws --key ${AWS_LAMBDA_KEY} --secret ${AWS_LAMBDA_SECRET}
- ./node_modules/.bin/serverless deploy --stage ${STAGE}
- step: &sonarqube-analysis
name: SonarQube analysis
image: sonarsource/sonar-scanner-cli:latest
caches:
- sonar
script:
- sonar-scanner
pipelines:
default:
- step: *compile
custom:
deploy-to-dev:
- step: *compile
- step:
<<: *deploy
deployment: test
name: Deploy to DEV
branches:
main:
- step: *compile
- step: *sonarqube-analysis
master:
- step: *compile
- step:
<<: *deploy
deployment: production
develop:
- step: *compile
- step:
<<: *deploy
deployment: test