-
Notifications
You must be signed in to change notification settings - Fork 22
/
Jenkinsfile
56 lines (56 loc) · 1.85 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
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '2'))
}
stages {
stage('cleanup') {
steps {
sh 'sh ./src/main/resources/scripts/jenkins.cleanup.sh'
sh '/opt/apache-maven-3.6.3/bin/mvn clean'
}
}
stage('build') {
steps {
sh 'JAVA_HOME=/usr/lib/jvm/java-11-openjdk /opt/apache-maven-3.6.3/bin/mvn install spotbugs:spotbugs -Denv=installer_template -DnvdApiKey=$NVD_API_KEY'
sh 'sh ./src/main/resources/scripts/jenkins.build.sh'
}
post {
success {
archiveArtifacts 'src/main/resources/setup/target/*.tgz'
}
}
}
stage('dependency-check') {
steps {
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
}
}
stage('spotbugs-analysis') {
steps {
recordIssues sourceCodeRetention: 'LAST_BUILD', tools: [spotBugs(id: 'spotbugs', name: 'SpotBugs', pattern: '**/target/spotbugsXml.xml', useRankAsPriority: true)]
}
}
stage('install') {
steps {
sh 'sh ./src/main/resources/scripts/jenkins.install.sh'
sh 'sudo systemctl start wildfly-26.1.3.Final@standalone'
sh 'sh ./src/main/resources/scripts/jenkins.checkgp.sh'
}
}
stage('test') {
steps {
sh 'cd ./integration-test; JAVA_HOME=/etc/alternatives/jre_1.8.0 /opt/apache-maven-3.6.3/bin/mvn clean test'
}
post {
always {
junit 'integration-test/target/surefire-reports/*.xml'
sh 'tar -cvf ./integration-test/target/surefire-reports.tar ./integration-test/target/surefire-reports/ --transform s#./integration-test/target/##'
sh 'gzip ./integration-test/target/surefire-reports.tar'
archiveArtifacts 'integration-test/target/surefire-reports.tar.gz'
}
}
}
}
}