generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 8
/
sbom_generation.yaml
54 lines (46 loc) · 2.78 KB
/
sbom_generation.yaml
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
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
# This OCI DevOps build specification file [1] generates a Software Bill of Materials (SBOM) of the repository.
# The file is needed to run checks for third-party vulnerabilities and business approval according to Oracle’s GitHub policies.
# [1] https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm
version: 0.1
component: build
timeoutInSeconds: 1000
shell: bash
steps:
- type: Command
name: "Run Maven cycloneDX plugin command"
command: |
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
cd spring-cloud-oci/
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ..
- type: Command
name: "Run Maven cycloneDX plugin command"
command: |
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
cd database/starters
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ../..
- type: Command
name: "Run Maven cycloneDX plugin command"
command: |
# For more details, visit https://github.com/CycloneDX/cyclonedx-maven-plugin/blob/master/README.md
cd database/spring-cloud-stream-binder-oracle-txeventq
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DincludeRuntimeScope=true -DincludeCompileScope=true -DincludeProvidedScope=false -DincludeSystemScope=false -DincludeTestScope=false -DoutputFormat=json -DoutputName=artifactSBOM -DschemaVersion=1.4
cd ../..
# Start merging the artifacts
- type: Command
name: "Download CycloneDx-cli executable and install dependencies"
command: |
wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.27.1/cyclonedx-linux-x64
yum install -y libicu
- type: Command
name: "Merge multiple SBOMs using CycloneDX-cli"
command: |
# For more details, visit https://github.com/CycloneDX/cyclonedx-cli/blob/main/README.md
chmod +x cyclonedx-linux-x64
./cyclonedx-linux-x64 merge --input-files ./spring-cloud-oci/target/artifactSBOM.json ./database/starters/target/artifactSBOM.json ./database/spring-cloud-stream-binder-oracle-txeventq/target/artifactSBOM.json --output-file merged-bom.json
outputArtifacts:
- name: artifactSBOM
type: BINARY
location: ${OCI_PRIMARY_SOURCE_DIR}/merged-bom.json