Skip to content

Commit

Permalink
Build sbom gen and sign tools (adoptium#732)
Browse files Browse the repository at this point in the history
* Build temurin-sing/gen/-sbom.jar

Signed-off-by: Sophia Guo <[email protected]>

* Testing

Signed-off-by: Sophia Guo <[email protected]>

* Enable slack message

Signed-off-by: Sophia Guo <[email protected]>

---------

Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo authored and luhenry committed Feb 3, 2024
1 parent 1025ff6 commit 41bb3e6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tools/code-tools/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ pipeline {
build('jtreg')
}
}
stage('temurin-sbom') {
agent {
label NODE_LABEL
}
steps {
build('temurin-sbom')
}
}
}
}
}
Expand All @@ -36,9 +44,15 @@ def build(stageName) {
docker.image('adoptopenjdk/centos7_build_image').inside {
try {
checkout scm
checkout([$class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${stageName}"]], submoduleCfg: [], userRemoteConfigs: [[url: "https://github.com/openjdk/${stageName}"]]])
script {
def toolsUrl = "https://github.com/openjdk/${stageName}"
if ( stageName == 'temurin-sbom' ) {
toolsUrl = "https://github.com/adoptium/temurin-build.git"
}
checkout([$class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${stageName}"]], submoduleCfg: [], userRemoteConfigs: [[url: toolsUrl]]])
}
sh label: "${stageName}", script: "./tools/code-tools/${stageName}.sh"
archiveArtifacts artifacts: "${stageName}/*.tar.gz, ${stageName}/${stageName}*.jar, ${stageName}/${stageName}*.jar.*.txt, ${stageName}/*.tar.gz.*sum*.txt, ${stageName}/${stageName}*.jar.html, ${stageName}/${stageName}*.jar.md", followSymlinks: false
archiveArtifacts artifacts: "**/temurin-*-sbom.jar, ${stageName}/*.tar.gz, ${stageName}/${stageName}*.jar, ${stageName}/${stageName}*.jar.*.txt, ${stageName}/*.tar.gz.*sum*.txt, ${stageName}/${stageName}*.jar.html, ${stageName}/${stageName}*.jar.md", followSymlinks: false
} catch (Exception e) {
slackSend channel: 'jenkins', color: 'danger', message: "${env.JOB_NAME} : #${env.BUILD_NUMBER} : ${stageName}() FAILED with following error message:\n${e}", teamDomain: 'adoptium'
throw new Exception("[ERROR] ${stageName} FAILED\n${e}")
Expand Down
10 changes: 10 additions & 0 deletions tools/code-tools/temurin-sbom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eu

echo 'Starting build process...'
export WORKSPACE="$WORKSPACE/temurin-sbom/cyclonedx-lib"
cd "$WORKSPACE"
export JAVA_HOME=/usr/lib/jvm/jdk-17
ant -f build.xml clean
ant -f build.xml build-sign-sbom
ant -f build.xml build

0 comments on commit 41bb3e6

Please sign in to comment.