forked from objectbox/objectbox-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile-Windows
More file actions
61 lines (50 loc) · 1.78 KB
/
Copy pathJenkinsfile-Windows
File metadata and controls
61 lines (50 loc) · 1.78 KB
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
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
String buildsToKeep = '500'
// https://jenkins.io/doc/book/pipeline/syntax/
pipeline {
agent { label 'windows' }
environment {
GITLAB_URL = credentials('gitlab_url')
}
options {
buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
gitLabConnection("${env.GITLAB_URL}")
}
triggers {
upstream(upstreamProjects: "objectbox-windows/${env.BRANCH_NAME.replaceAll("/", "%2F")}",
threshold: hudson.model.Result.SUCCESS)
}
stages {
stage('init') {
steps {
// "cmd /c" for an OK exit code if no file is found
bat 'cmd /c del tests\\objectbox-java-test\\hs_err_pid*.log'
}
}
stage('build-java') {
steps {
bat 'gradlew cleanTest build test install'
}
}
}
// For global vars see /jenkins/pipeline-syntax/globals
post {
always {
junit '**/build/test-results/**/TEST-*.xml'
archive 'tests/*/hs_err_pid*.log'
archive '**/build/reports/findbugs/*'
}
changed {
slackSend color: COLOR_MAP[currentBuild.currentResult],
message: "Changed to ${currentBuild.currentResult}: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
}
failure {
slackSend color: "danger",
message: "Failed: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
updateGitlabCommitStatus name: 'build-windows', state: 'failed'
}
success {
updateGitlabCommitStatus name: 'build-windows', state: 'success'
}
}
}