Skip to content

Commit 59cda11

Browse files
committed
Jenkinsfile: set up gchat notification, add a 1h timeout
1 parent 2311a18 commit 59cda11

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

Jenkinsfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pipeline {
2121

2222
options {
2323
buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
24+
timeout(time: 1, unit: 'HOURS') // If build hangs (regular build should be much quicker)
2425
gitLabConnection("${env.GITLAB_URL}")
2526
}
2627

@@ -69,15 +70,13 @@ pipeline {
6970
BINTRAY_LOGIN = credentials('bintray_login')
7071
}
7172
steps {
72-
script {
73-
slackSend color: "#42ebf4",
74-
message: "Publishing ${currentBuild.fullDisplayName} to Bintray...\n${env.BUILD_URL}"
75-
}
73+
googlechatnotification url: 'id:gchat_java',
74+
message: "*Publishing* ${currentBuild.fullDisplayName} to Bintray...\n${env.BUILD_URL}"
75+
7676
sh "./gradlew $gradleArgs -PpreferredRepo=${BINTRAY_URL} -PpreferredUsername=${BINTRAY_LOGIN_USR} -PpreferredPassword=${BINTRAY_LOGIN_PSW} uploadArchives"
77-
script {
78-
slackSend color: "##41f4cd",
79-
message: "Published ${currentBuild.fullDisplayName} successfully to Bintray - check https://bintray.com/objectbox/objectbox\n${env.BUILD_URL}"
80-
}
77+
78+
googlechatnotification url: 'id:gchat_java',
79+
message: "Published ${currentBuild.fullDisplayName} successfully to Bintray - check https://bintray.com/objectbox/objectbox\n${env.BUILD_URL}"
8180
}
8281
}
8382

@@ -89,6 +88,9 @@ pipeline {
8988
junit '**/build/test-results/**/TEST-*.xml'
9089
archive 'tests/*/hs_err_pid*.log'
9190
archive '**/build/reports/findbugs/*'
91+
92+
googlechatnotification url: 'id:gchat_java', message: "${currentBuild.currentResult}: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}",
93+
notifyFailure: 'true', notifyUnstable: 'true', notifyBackToNormal: 'true'
9294
}
9395

9496
failure {

0 commit comments

Comments
 (0)