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 all 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
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