Skip to content

Commit d4968c5

Browse files
authored
Merge pull request #814 from oracle/config/adding-sbom-config
SBOM creation
2 parents 03bb144 + a953131 commit d4968c5

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

sbom_generation.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
3+
# This OCI DevOps build specification file [1] generates a Software Bill of Materials (SBOM) of the repository.
4+
# The file is needed to run checks for third-party vulnerabilities and business approval according to Oracle’s GitHub policies.
5+
# [1] https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm
6+
7+
version: 0.1
8+
component: build
9+
timeoutInSeconds: 1000
10+
shell: bash
11+
12+
steps:
13+
- type: Command
14+
name: "Install npm"
15+
command: |
16+
# Install npm version 8.19.4
17+
18+
- type: Command
19+
name: "Install node-cli & unit-testing packages"
20+
command: |
21+
npm install --ignore-scripts
22+
- type: Command
23+
name: "Install cyclonedx globally"
24+
command: |
25+
npm install --ignore-scripts -g @cyclonedx/cyclonedx-npm
26+
- type: Command
27+
name: "Run cyclonedx for node-cli & unit-testing packages"
28+
command: |
29+
# For more details, visit https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/README.md
30+
npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file artifactSBOM_node-cli_unit-testing.json --spec-version 1.4
31+
- type: Command
32+
name: "Install vscode extension package"
33+
command: |
34+
cd packages/vscode-extension && npm install --ignore-scripts
35+
- type: Command
36+
name: "Run cyclonedx for vscode-extension package"
37+
command: |
38+
# For more details, visit https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/README.md
39+
cd packages/vscode-extension && npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file artifactSBOM_vscode-extension.json --spec-version 1.4
40+
- type: Command
41+
name: "Download CycloneDx-linux-cli executable and install dependencies"
42+
command: |
43+
wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.24.2/cyclonedx-linux-x64
44+
yum install -y libicu
45+
- type: Command
46+
name: "Merge multiple SBOMs using CycloneDX-linux-cli"
47+
command: |
48+
# For more details, visit https://github.com/CycloneDX/cyclonedx-cli/blob/main/README.md
49+
chmod +x cyclonedx-linux-x64
50+
./cyclonedx-linux-x64 merge --input-files artifactSBOM_node-cli_unit-testing.json packages/vscode-extension/artifactSBOM_vscode-extension.json --output-file artifactSBOM.json
51+
outputArtifacts:
52+
- name: artifactSBOM
53+
type: BINARY
54+
location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json

0 commit comments

Comments
 (0)