Skip to content

Commit

Permalink
Limit json file to SBOM specific and remove unnecessary code
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Jun 12, 2023
1 parent 3efb4de commit cf01432
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/reproduce_comparison/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ pipeline {
steps {
cleanWs()
checkout scm
copyArtifacts excludes: '**/OpenJDK*-sbom*metadata.json',
copyArtifacts excludes: '**/OpenJDK*-sbom*metadata.json,**/OpenJDK*-jdk-sources*.tar.gz',
filter: '**/OpenJDK*-jdk*.tar.gz,**/OpenJDK*-sbom*.json',
fingerprintArtifacts: true,
flatten: true,
projectName: "${params.COMPARED_JOB_NAME}",
target: 'original/'
selector: specific("${params.COMPARED_JOB_NUMBER}")
script {
def sbomFiles = findFiles(glob: "**/*.json")
def sbomParams = readJSON file: "${sbomFiles[0].name}"
def sbomFiles = findFiles(glob: "**/OpenJDK*-sbom*.json")
def sbomParams = readJSON file: "${sbomFiles[0].path}"

def sbomProperties = sbomParams.components[0].properties
def reproducedParams = [:]
Expand All @@ -44,8 +44,6 @@ pipeline {
def buildRef = reproducedParams["Temurin Build Ref"]
def buildTimeStamp = reproducedParams["Build Timestamp"]
buildRef = buildRef.substring(buildRef.lastIndexOf('/')+1)
def scmCommit = reproducedParams["OpenJDK Source Commit"]
scmCommit = scmCommit.substring(scmCommit.lastIndexOf('/')+1)

// Convert COMPARED_JOB_PARAMS to json formatt string
def jobParams = COMPARED_JOB_PARAMS.replaceAll("=", ':')
Expand Down Expand Up @@ -78,7 +76,8 @@ pipeline {
copyArtifacts(
projectName:"${COMPARED_JOB_NAME}",
selector:specific("${reproducibleJob.getNumber()}"),
filter: "**/*.tar.gz",
excludes: '**/OpenJDK*-jdk-sources*.tar.gz',
filter: '**/OpenJDK*-jdk*.tar.gz',
target: 'reproduced/',
fingerprintArtifacts: true,
flatten: true
Expand Down

0 comments on commit cf01432

Please sign in to comment.