-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultibranch.jenkins
More file actions
32 lines (31 loc) · 1002 Bytes
/
multibranch.jenkins
File metadata and controls
32 lines (31 loc) · 1002 Bytes
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
#!/usr/local/bin/groovy
def pipeline
node {
def scmVars = checkout scm
println scmVars
ansiColor('xterm') {
try {
env.SLACK_CHANNEL = "#jdrf-builds"
dir("${env.WORKSPACE}") {
stage('Build') {
sh 'sh gradlew assembleDebug'
}
stage('Tests') {
sh 'sh gradlew test'
}
stage('Notify') {
slackSend channel: "${env.SLACK_CHANNEL}", color: 'good', message: "Build ${env.BUILD_NUMBER} for branch ${env.BRANCH_NAME} successful. See results <${env.BUILD_URL}|here>."
}
stage('Clean') {
cleanWs()
}
}
} catch(exc) {
slackSend channel: "${env.SLACK_CHANNEL}", color: '#ff0000', message: "Build ${env.BUILD_NUMBER} for branch ${env.BRANCH_NAME} failed. See results <${env.BUILD_URL}|here>."
stage('Clean') {
cleanWs()
}
throw exc
}
}
}