Skip to content

Commit 2437ade

Browse files
committed
add Jenkinsfile-Windows
1 parent ec1d9e4 commit 2437ade

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

ci/Jenkinsfile-Windows

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
2+
3+
String buildsToKeep = '500'
4+
5+
// https://jenkins.io/doc/book/pipeline/syntax/
6+
pipeline {
7+
agent { label 'windows' }
8+
9+
options {
10+
buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
11+
}
12+
13+
triggers {
14+
upstream(upstreamProjects: "objectbox-windows/${env.BRANCH_NAME.replaceAll("/", "%2F")}",
15+
threshold: hudson.model.Result.SUCCESS)
16+
cron(cronSchedule)
17+
}
18+
19+
stages {
20+
stage('init') {
21+
steps {
22+
// "cmd /c" for an OK exit code if no file is found
23+
bat 'cmd /c del tests/objectbox-java-test/hs_err_pid*.log'
24+
}
25+
}
26+
27+
stage('build-java') {
28+
steps {
29+
bat 'gradlew build install'
30+
}
31+
}
32+
33+
// For global vars see /jenkins/pipeline-syntax/globals
34+
post {
35+
always {
36+
junit '**/build/test-results/**/TEST-*.xml'
37+
archive 'tests/*/hs_err_pid*.log'
38+
archive '**/build/reports/findbugs/*'
39+
}
40+
41+
changed {
42+
slackSend color: COLOR_MAP[currentBuild.currentResult],
43+
message: "Changed to ${currentBuild.currentResult}: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
44+
}
45+
46+
failure {
47+
slackSend color: "danger",
48+
message: "Failed: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)