-
Notifications
You must be signed in to change notification settings - Fork 60
/
jenkinsfile.generate-snca-report
65 lines (57 loc) · 3.04 KB
/
jenkinsfile.generate-snca-report
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
64
pipeline {
agent {
node {
label 'master'
}
}
parameters {
string name: 'job_to_copy_from', defaultValue: 'verinice/develop',
description: '''The job that the SNCA is copied from<br/>
Please note that slashes in the branch-name must be escaped as %2F, e.g. <code>verinice/feature%2Fvn-0000-make-everything-great</code>.'''
buildSelector name: 'build_to_copy_from',
description: 'The build number of the job that the SNCA is copied from'
}
stages {
stage('SNCA Report') {
steps {
copyArtifacts filter: "**/WEB-INF/SNCA.xml,**/WEB-INF/snca-messages*.properties",
fingerprintArtifacts: true, flatten: true,
projectName: params.job_to_copy_from,
selector: buildParameter(params.build_to_copy_from)
sh '''
mkdir -p $WORKSPACE/snca/importProject/export
mkdir -p $WORKSPACE/snca/.metadata/.plugins/org.eclipse.core.runtime/.settings
'''
withEnv(["SNCAEDITOR=${tool name: 'snca-editor1', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'}"]) {
sh '''
echo "
//con.disabled/de.sernet.eclipse.hui.model.validation.basicConstrain=true
//con.disabled/de.sernet.eclipse.hui.model.validation.testidfromat=true
//con.disabled/de.sernet.eclipse.hui.model.validation.testnumericoption=true
eclipse.preferences.version=1
" > $WORKSPACE/snca/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.emf.validation.prefs
$SNCAEDITOR/snca-editor -nosplash -data $WORKSPACE/snca \
-application de.sernet.eclipse.hui.commandline.commandlinerunner \
-i $WORKSPACE/SNCA.xml \
-export \
-generateWiki -validate INFO > $WORKSPACE/snca/snca-output.txt
cd $WORKSPACE/snca/importProject/src-gen/
dot -T png -O image/*.dot
'''
}
archiveArtifacts artifacts : 'snca/snca-output.txt,snca/importProject/**/*.*'
recordIssues(
qualityGates: [[threshold: 1, type: 'DELTA_ERROR', unstable: true]],
tools: [groovyScript(id: 'snca-validation',
name: 'snca-validation',
parserId: 'snca-validation',
pattern: 'snca/snca-output.txt')])
publishHTML([allowMissing: true,
alwaysLinkToLastBuild: true, keepAll: false,
reportDir: 'snca/importProject/src-gen/',
reportFiles: 'iso-doc-de.html,mogs-doc-de.html,old-mogs-doc-de.html,configuration-doc-de.html,iso-doc-en.html,mogs-doc-en.html,old-mogs-doc-en.html,configuration-doc-en.html',
reportName: 'SNCA Report', reportTitles: ''])
}
}
}
}