forked from sscpac/statick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
55 lines (52 loc) · 1.36 KB
/
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
pipeline {
agent {
dockerfile {
label 'docker'
}
}
environment {
LANG = 'en_US.UTF-8'
JAVA_OPTS = "-Xmx8292m"
}
stages {
stage('Clean Workspace') {
steps {
sh '''
rm -rf statick_output *.tar.xz
'''
}
}
stage('Checkout Statick') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'statick']], userRemoteConfigs: [[url: "https://github.com/sscpac/statick.git"]]])
}
}
# Add stages to check out (if needed) and build your project here
stage('Run Statick') {
steps {
# If you have multiple modules, you can optionally make this a for loop over the directories you care about
sh '''#!/bin/bash -e
mkdir -p statick_output
echo "Starting statick runs"
./statick/statick . --output-directory statick_output --profile sei_cert.yaml
'''
}
}
stage('Collect Statick Results') {
steps {
// Options at https://jenkins.io/doc/pipeline/steps/warnings-ng/
recordIssues(
enabledForFailure: true,
qualityGates: [[threshold: 1, type: 'TOTAL']],
tools: [issues(name: 'Statick', pattern: 'statick_output/*.json.statick')]
)
}
}
stage('Archive Results') {
steps {
sh 'tar -cJvf statick_results_${BUILD_NUMBER}.tar.xz statick_output/*.statick'
archiveArtifacts '*.tar.xz'
}
}
}
}