|
1 | | -// Build once a day |
2 | | -CRON_SETTINGS = '''H H * * *''' |
3 | | -NODE_LABEL = 'dockerBuild&&linux&&x64' |
| 1 | +NODE_LABEL = 'dockerBuild&&linux&&x64&&gpgsign' |
4 | 2 |
|
5 | 3 | pipeline { |
6 | 4 | agent none |
7 | 5 | parameters { |
8 | | - string(name: 'UPSTREAM_JOB_NAME', defaultValue: '', description: 'Pipeline job with sbom filesCompared nightly build job name') |
| 6 | + string(name: 'UPSTREAM_JOB_NAME', defaultValue: '', description: 'Pipeline job with sbom files') |
9 | 7 | string(name: 'UPSTREAM_JOB_NUMBER', defaultValue: '', description: 'Pipeline job number') |
10 | 8 |
|
11 | 9 | } |
@@ -37,25 +35,28 @@ def sbomSign() { |
37 | 35 | projectName: "${params.UPSTREAM_JOB_NAME}", |
38 | 36 | target: 'sbom/', |
39 | 37 | selector: specific("${params.UPSTREAM_JOB_NUMBER}") |
40 | | - script { |
41 | | - dir("sbomSign/cyclonedx-lib") { |
42 | | - sh label: 'build-sign-sbom', script: ''' |
43 | | - JAVA_HOME=/usr/lib/jvm/jdk-17 ant clean |
44 | | - JAVA_HOME=/usr/lib/jvm/jdk-17 ant build-sign-sbom |
45 | | - openssl genpkey -algorithm RSA -pass pass:test -outform PEM -out testPrivateFile -pkeyopt rsa_keygen_bits:2048 |
46 | | - openssl rsa -in testPrivateFile -passin pass:test -pubout -out publicPemFile |
47 | | - ''' |
48 | | - } |
49 | | - def sbomFiles = findFiles(glob: "**/OpenJDK*-sbom*.json") |
50 | | - for (def sbomFile: sbomFiles) { |
51 | | - def sbomFileName = sbomFile.path |
52 | | - def classPath = "sbomSign/cyclonedx-lib/build/jar/*" |
53 | | - sh label: 'sign-sbom', script: """ |
54 | | - /usr/lib/jvm/jdk-17/bin/java -cp "${classPath}" temurin.sbom.TemurinSignSBOM --signSBOM --jsonFile ${sbomFileName} --privateKeyFile ./sbomSign/cyclonedx-lib/testPrivateFile |
55 | | - /usr/lib/jvm/jdk-17/bin/java -cp "${classPath}" temurin.sbom.TemurinSignSBOM --verifySignature --jsonFile ${sbomFileName} --publicKeyFile ./sbomSign/cyclonedx-lib/publicPemFile |
56 | | - """ |
57 | | - } |
| 38 | + withCredentials([file(credentialsId: 'adoptium-artifactory-gpg-key', variable: 'PRIVATE_GPG_KEY')]) { |
| 39 | + withEnv(['PRIVATE_GPG_KEY='+${PRIVATE_GPG_KEY}]) { |
| 40 | + script { |
| 41 | + dir("sbomSign/cyclonedx-lib") { |
| 42 | + sh label: 'build-sign-sbom', script: ''' |
| 43 | + JAVA_HOME=/usr/lib/jvm/jdk-17 ant clean |
| 44 | + JAVA_HOME=/usr/lib/jvm/jdk-17 ant build-sign-sbom |
| 45 | + ''' |
| 46 | + } |
| 47 | + def sbomFiles = findFiles(glob: "**/OpenJDK*-sbom*.json") |
| 48 | + for (def sbomFile: sbomFiles) { |
| 49 | + def sbomFileName = sbomFile.path |
| 50 | + def classPath = "sbomSign/cyclonedx-lib/build/jar/*" |
| 51 | + sh label: 'sign-sbom', script: """ |
| 52 | + /usr/lib/jvm/jdk-17/bin/java -cp "${classPath}" temurin.sbom.TemurinSignSBOM --signSBOM --jsonFile ${sbomFileName} --privateKeyFile ./sbomSign/cyclonedx-lib/testPrivateFile |
| 53 | + /usr/lib/jvm/jdk-17/bin/java -cp "${classPath}" temurin.sbom.TemurinSignSBOM --verifySignature --jsonFile ${sbomFileName} --publicKeyFile ./sbomSign/cyclonedx-lib/publicPemFile |
| 54 | + """ |
| 55 | + } |
| 56 | + } |
| 57 | + }// some block |
58 | 58 | } |
| 59 | + |
59 | 60 | archiveArtifacts artifacts: "**/OpenJDK*-sbom*.json" |
60 | 61 | } |
61 | 62 | } |
0 commit comments