Skip to content

Commit

Permalink
feat: add archive sbom.json in Jenkins build.
Browse files Browse the repository at this point in the history
  • Loading branch information
zdtsw committed May 20, 2022
1 parent 66fcbd4 commit 06faf8d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,11 @@ getStaticLibsArchivePath() {
echo "${jdkArchivePath}-static-libs"
}

getSbomArchivePath(){
local jdkArchivePath=$(getJdkArchivePath)
echo "${jdkArchivePath}/metadata/sbom.json"
}

# Clean up
removingUnnecessaryFiles() {
local jdkTargetPath=$(getJdkArchivePath)
Expand Down Expand Up @@ -1449,6 +1454,7 @@ createOpenJDKTarArchive() {
local testImageTargetPath=$(getTestImageArchivePath)
local debugImageTargetPath=$(getDebugImageArchivePath)
local staticLibsImageTargetPath=$(getStaticLibsArchivePath)
local sbomTargetPath=${getSbomArchivePath}

echo "OpenJDK JDK path will be ${jdkTargetPath}. JRE path will be ${jreTargetPath}"

Expand Down Expand Up @@ -1489,6 +1495,11 @@ createOpenJDKTarArchive() {
echo "OpenJDK static libs archive file name will be ${staticLibsImageName}."
createArchive "${staticLibsImageTargetPath}" "${staticLibsImageName}"
fi
if [ -d "${sbomTargetPath}" ]; then
echo "OpenJDK SBOM path will be ${sbomTargetPath}."
local sbomName=$(echo "${BUILD_CONFIG[TARGET_FILE_NAME]//-jdk/-sbom}")
createArchive "${sbomTargetPath}" "${sbomName}"
fi
# for macOS system, code sign directory before creating tar.gz file
if [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "darwin" ] && [ -n "${BUILD_CONFIG[MACOSX_CODESIGN_IDENTITY]}" ]; then
codesign --options runtime --timestamp --sign "${BUILD_CONFIG[MACOSX_CODESIGN_IDENTITY]}" "${jdkTargetPath}"
Expand Down

0 comments on commit 06faf8d

Please sign in to comment.