forked from B3Partners/brmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
112 lines (93 loc) · 5.67 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
timestamps {
properties([
[$class: 'jenkins.model.BuildDiscarderProperty', strategy: [$class: 'LogRotator',
artifactDaysToKeepStr: '8',
artifactNumToKeepStr: '3',
daysToKeepStr: '15',
numToKeepStr: '5']
]]);
node {
withEnv(["JAVA_HOME=${ tool 'JDK8' }", "PATH+MAVEN=${tool 'Maven 3.5.2'}/bin:${env.JAVA_HOME}/bin"]) {
stage('Prepare') {
sh "ulimit -a"
sh "free -h"
checkout scm
}
stage('Prepare data') {
sh ".jenkins/data-prepare-topnl.sh"
}
stage('Build') {
echo "Building branch: ${env.BRANCH_NAME}"
sh "mvn clean install -Dmaven.test.skip=true -B -V -e -fae -q -Poracle -pl '!brmo-dist'"
}
stage('Test') {
echo "Running unit tests"
sh "mvn -e test -B -Poracle -pl '!brmo-dist'"
}
lock('brmo-oracle') {
stage('Prepare Oracle Databases') {
echo "cleanup schema's"
sh "sqlplus -l -S jenkins_rsgb/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S jenkins_rsgbbgt/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S jenkins_staging/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top10nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top50nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top100nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top250nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
echo "init schema's"
sh ".jenkins/db-prepare-staging.sh"
sh ".jenkins/db-prepare-rsgb.sh"
sh ".jenkins/db-prepare-rsgbbgt.sh"
sh ".jenkins/db-prepare-topnl.sh"
}
stage('bgt-gml-loader Integration Test') {
echo "run integratie tests voor bgt-gml-loader module"
sh "mvn -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'bgt-gml-loader'"
}
stage('brmo-loader Integration Test') {
echo "run integratie tests voor brmo-loader module"
sh "mvn -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'brmo-loader'"
}
stage('brmo-service Integration Test') {
echo "run integratie tests voor brmo-service module"
timeout(10) {
try {
sh "mvn -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'brmo-service'"
} catch (Exception e) {
currentBuild.result = 'UNSTABLE'
}
}
}
stage('brmo-soap Integration Test') {
echo "run integratie tests voor brmo-soap module"
sh "mvn -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'brmo-soap'"
}
stage('brmo-stufbg204 Integration Test') {
echo "run integratie tests voor brmo-stufbg204 module"
sh "mvn -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'brmo-stufbg204'"
}
stage('brmo-commandline Integration Test') {
echo "run integratie tests voor brmo-commandline module"
sh "mvn -Djava.security.egd=file:/dev/./urandom -e verify -B -Poracle -T1 -Dtest.onlyITs=true -pl 'brmo-commandline'"
}
stage('Cleanup Database') {
sh "sqlplus -l -S jenkins_rsgbbgt/[email protected]:1521/DB01 < ./bgt-gml-loader/target/generated-resources/ddl/oracle/drop_rsgb_bgt.sql"
sh "sqlplus -l -S jenkins_staging/[email protected]:1521/DB01 < ./brmo-persistence/db/drop-brmo-persistence-oracle.sql"
sh "sqlplus -l -S jenkins_rsgb/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top10nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top50nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top100nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
sh "sqlplus -l -S top250nl/[email protected]:1521/DB01 < ./.jenkins/clear-schema.sql"
}
}
stage('Publish Results') {
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/TEST-*.xml'
}
stage('OWASP Dependency Check') {
echo "Uitvoeren OWASP dependency check"
dependencyCheckAnalyzer datadir: '', hintsFile: '', includeCsvReports: false, includeHtmlReports: true, includeJsonReports: false, isAutoupdateDisabled: false, outdir: '', scanpath: '**/brmo-*.jar,**/brmo-*.war,**/brmo-*.zip', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '.mvn/owasp-suppression.xml', zipExtensions: ''
dependencyCheckPublisher canComputeNew: false, defaultEncoding: '', healthy: '85', pattern: '**/dependency-check-report.xml', shouldDetectModules: true, unHealthy: ''
}
}
}
}