-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.sqe
60 lines (51 loc) · 3.2 KB
/
Jenkinsfile.sqe
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
@Library('SPiFI-1.2.1') _
properties([
parameters([
booleanParam(defaultValue: true, description: 'Download artifacts?', name: 'P_DOWNLOAD_ARTIFACTS'),
booleanParam(defaultValue: false, description: 'Clean src dir?', name: 'P_CLEAN'),
booleanParam(defaultValue: true, description: 'Configure?', name: 'P_CONFIGURE'),
booleanParam(defaultValue: true, description: 'Build?', name: 'P_BUILD'),
booleanParam(defaultValue: true, description: 'Install?', name: 'P_INSTALL'),
booleanParam(defaultValue: true, description: 'Upload artifacts?', name: 'P_UPLOAD_ARTIFACTS'),
booleanParam(defaultValue: true, description: 'Run Tests?', name: 'P_RUN_TESTS'),
booleanParam(defaultValue: true, description: 'Run Static Code Analysis?', name: 'P_RUN_ANALYSIS'),
booleanParam(defaultValue: true, description: 'Deploy Artifacts?', name: 'P_DEPLOY'),
string(defaultValue: 'sstresource&&baserhel8', description: 'Select machine', name: 'P_NODE_LABEL')])
])
node {
stage('Creating sub-jobs') {
String[] sstsimulatorRepos = ['sst-core']
//TODO: String[] nodeLabels = ['sstresource&&baserhel8', 'sstresource&&COERHEL7']
//TODO: nodeLabels.each { launcher.appendJob ... }
def launcher = new gov.sandia.sems.spifi.JobLauncher(this)
sh 'echo "----"; env | grep "P_"; echo "----"'
sstsimulatorRepos.eachWithIndex {repo, i ->
launcher.appendJob(label: repo, job_name: "$JOB_NAME" + "-" + repo,
parameters: [
(string(name:"SST_BASE_JOB_NAME", value:"$JOB_NAME")),
(string(name:"P_NODE_LABEL", value:"${params.P_NODE_LABEL}")),
booleanParam(name:"P_DOWNLOAD_ARTIFACTS", value: "${params.P_DOWNLOAD_ARTIFACTS}"),
booleanParam(name:"P_CLEAN", value: "${params.P_CLEAN}"),
booleanParam(name:"P_CONFIGURE", value: "${params.P_CONFIGURE}"),
booleanParam(name:"P_BUILD", value: "${params.P_BUILD}"),
booleanParam(name:"P_INSTALL", value: "${params.P_INSTALL}"),
booleanParam(name:"P_UPLOAD_ARTIFACTS", value: "${params.P_UPLOAD_ARTIFACTS}"),
booleanParam(name:"P_RUN_TESTS", value: "${params.P_RUN_TESTS}"),
booleanParam(name:"P_RUN_ANALYSIS", value: "${params.P_RUN_ANALYSIS}"),
booleanParam(name:"P_DEPLOY", value: "${params.P_DEPLOY}")
]
)
}
launcher.printJobList()
println "lost control"
launcher.launchInParallel()
println "got control back"
def summary = launcher.getLastResultSummary()
def results_util = new gov.sandia.sems.spifi.ResultsUtility(env: this)
println results_util.genResultSummaryTable(format: "ASCII", summary: summary)
if(summary.NUMJOBS != summary.NUMSUCCESS) {
currentBuild.result = 'FAILURE'
return
}
}
}