Skip to content

Commit 24ed2fb

Browse files
authored
Add sbom_generation.yaml
1 parent 13b3bbb commit 24ed2fb

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

sbom_generation.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
env:
12+
variables:
13+
"JAVA_HOME": "/usr/lib64/graalvm/graalvm22-ee-java17"
14+
steps:
15+
- type: Command
16+
name: "Update graalvm version"
17+
command: |
18+
yum -y install graalvm22-ee-17-jdk
19+
export PATH=$JAVA_HOME/bin:$PATH
20+
21+
- type: Command
22+
name: "Run Gradle cyclonedxBom command"
23+
command: |
24+
# For more details, visit https://github.com/CycloneDX/cyclonedx-gradle-plugin/blob/master/README.md
25+
cat <<EOF >> init.gradle
26+
initscript {
27+
repositories {
28+
maven {
29+
url "https://plugins.gradle.org/m2/"
30+
}
31+
}
32+
dependencies {
33+
classpath "org.cyclonedx:cyclonedx-gradle-plugin:2.1.0"
34+
}
35+
}
36+
allprojects {
37+
apply plugin:org.cyclonedx.gradle.CycloneDxPlugin
38+
cyclonedxBom {
39+
includeConfigs = ["runtimeClasspath", "compileClasspath"]
40+
skipConfigs = ["testCompileClasspath"]
41+
projectType = "application"
42+
destination = file(".")
43+
outputName = "artifactSBOM"
44+
outputFormat = "json"
45+
schemaVersion = "1.4"
46+
}
47+
}
48+
EOF
49+
./gradlew --init-script init.gradle cyclonedxBom -info
50+
outputArtifacts:
51+
- name: artifactSBOM
52+
type: BINARY
53+
location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json

0 commit comments

Comments
 (0)