Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build sbom gen and sign tools #732

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 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,11 +44,17 @@ 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'
//slackSend channel: 'jenkins', color: 'danger', message: "${env.JOB_NAME} : #${env.BUILD_NUMBER} : ${stageName}() FAILED with following error message:\n${e}", teamDomain: 'adoptium'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment for testing. Re-enabled. Thanks.

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