forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
57 lines (49 loc) · 1.62 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
56
57
pipeline {
agent any
environment {
MAVEN_OPTS = '-Xmx1024m'
}
tools {
maven 'Maven_3.9.5'
jdk 'JDK_21'
}
stages {
stage('Checkout Source') {
steps {
// Checkout the source code from the branch that triggered the build
git url: 'https://github.com/BD-HUGO/hugo-demo-webgoat.git', branch: "${env.BRANCH_NAME}"
}
}
stage('Cov-Build') {
steps {
sh 'synopsys_scan coverity_args: '--enable-audit-mode --webapp-security --aggressiveness-level high -j auto', coverity_build_command: 'cov-build --dir idir mvn clean compile', coverity_config_path: 'C:/Program Files/Coverity/Coverity Static Analysis/config/template-java-config-0/coverity_config.xml', coverity_local: true, coverity_prComment_enabled: true, coverity_project_name: 'e jenkins-ci-demo-java', coverity_stream_name: 'e jenkins-ci-demo-java-1', mark_build_status: 'UNSTABLE', product: 'coverity''
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('Package') {
steps {
sh 'mvn package'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true
}
}
}
post {
always {
cleanWs()
}
success {
echo "Build succeeded on branch ${env.BRANCH_NAME}"
}
failure {
echo "Build failed on branch ${env.BRANCH_NAME}"
}
}
}