-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSBOMGenerator.jenkinsfile
63 lines (54 loc) · 1.8 KB
/
SBOMGenerator.jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '20'))
skipDefaultCheckout true
timeout(time: 20, unit: 'MINUTES')
}
tools {
jdk 'temurin-jdk21-latest'
}
environment {
MAIL_TO = 'ed.merks@gmail.com'
}
stages {
stage('SBOM Generator') {
steps {
sh '''
set -o pipefail
curl -O https://download.eclipse.org/cbi/updates/p2-sbom/products/nightly/latest/org.eclipse.cbi.p2repo.sbom.cli.product-linux.gtk.x86_64.tar.gz
tar --warning=no-unknown-keyword -xf org.eclipse.cbi.p2repo.sbom.cli.product-linux.gtk.x86_64.tar.gz
cbi-sbom/cbi-sbom \
-application org.eclipse.cbi.p2repo.sbom.generator \
-consoleLog \
-noSplash \
-verbose \
-input https://download.eclipse.org/eclipse/updates/4.34/R-4.34-202411201800 \
-xml-output eclipse-sdk-4.34-sbom.xml \
-json-output eclipse-sdk-4.34-sbom.json \
-vmargs \
-Dfile.encoding=UTF-8 2>&1 | tee log
'''
}
}
stage('Archive Results') {
steps {
archiveArtifacts '*.xml,*.json'
}
}
}
post {
failure {
mail to: env.MAIL_TO,
subject: "[SBOM Generator] Build Failure ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: <a href='${env.BUILD_URL}'>${env.BUILD_URL}</a>"
}
fixed {
mail to: env.MAIL_TO,
subject: "[SBOM Generator] Back to normal ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: <a href='${env.BUILD_URL}'>${env.BUILD_URL}</a>"
}
}
}