-
Notifications
You must be signed in to change notification settings - Fork 2
/
bitbucket-pipelines.yml
74 lines (66 loc) · 2.3 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
options:
max-time: 15
image: tactful/ci-cd:v13.5
definitions:
steps:
- step: &Check-Vulnerabilities
name: check-vulnerabilities
image: tactful/vulnr-scan:v1.0.0
script:
- syft . --scope all-layers -o spdx-json > sbom.json
# - cat ./sbom.json | grype --fail-on critical > vulnr.txt
artifacts: #exporting the sbom.json and vulnr.txt to be available for other steps
- sbom.json
- vulnr.txt
- step: &Run-Unit-Tests
name: Test
caches:
- node
script:
- npm run login
- npm install
- step: &SonarQube-analysis
name: SonarQube analysis
image: sonarsource/sonar-scanner-cli:latest
script:
- sonar-scanner -Dsonar.projectKey=automation-partner -Dsonar.sources=./src -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} || true
- step: &Build-automation-partner-Image
name: Build automation-partner Image
services: # enable Docker because we will build an image
- docker
script:
- /usr/local/bin/build.sh automation_partner ${BITBUCKET_TAG} ./Dockerfile
- step: &Update-DEV-Tag
name: Update Infra DEV Tag
image: tactful/ci-cd:v13.11
trigger: manual
script:
- /usr/local/bin/update_infra_tag.sh dev .automation_partner.tag ${BITBUCKET_TAG}
- step: &Update-QA-Tag
name: Update Infra QA Tag
image: tactful/ci-cd:v13.11
trigger: manual
script:
- /usr/local/bin/update_infra_tag.sh qa .automation_partner.tag ${BITBUCKET_TAG}
- step: &Update-Demo-Dstynengage-Tag
name: Update Infra Demo Dstnyengage Tag
image: tactful/ci-cd:v13.11
trigger: manual
script:
- /usr/local/bin/update_infra_tag.sh demo-dstnyengage .automation_partner.tag ${BITBUCKET_TAG}
pipelines:
tags:
v*.*.*:
# - step: *Check-Vulnerabilities
# - step: *Run-Unit-Tests
# - step: *SonarQube-analysis
- step: *Build-automation-partner-Image
- parallel:
- step: *Update-DEV-Tag
- step: *Update-QA-Tag
- step: *Update-Demo-Dstynengage-Tag
pull-requests:
"**":
- step: *Check-Vulnerabilities
- step: *Run-Unit-Tests
- step: *SonarQube-analysis