diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-15 12:37:38 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-15 12:37:38 +0200 |
commit | cc3f12cd93aa705433ce92a468ffc70c17860142 (patch) | |
tree | 7925ad8bfb2f73f683970288207d1003a7a42309 /Jenkinsfile | |
parent | c8302cd6fcac53ce7d20e8fbfe9db5d3dc3a2cd3 (diff) | |
download | vyos-build-cc3f12cd93aa705433ce92a468ffc70c17860142.tar.gz vyos-build-cc3f12cd93aa705433ce92a468ffc70c17860142.zip |
Jenkins: set GitHub build info on failure/success
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 68e0e724..4383f230 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { stage('Configure') { steps { script { - setGitHubStatus("pending", "Build pending") + setGitHubStatus("pending", "Build is pending.") sh """ ./configure --build-by="autobuild@vyos.net" --debian-mirror="http://ftp.us.debian.org/debian/" """ @@ -120,13 +120,13 @@ pipeline { } post { success { - // publish build result, using SSH-dev.packages.vyos.net Jenkins Credentials - sshagent(['SSH-dev.packages.vyos.net']) { - script { - // only deploy ISO if build from official repository - if (isCustomBuild()) - return + script { + // only deploy ISO if build from official repository + if (isCustomBuild()) + return + // publish build result, using SSH-dev.packages.vyos.net Jenkins Credentials + sshagent(['SSH-dev.packages.vyos.net']) { // build up some fancy groovy variables so we do not need to write/copy // every option over and over again! def ARCH = sh(returnStdout: true, script: "dpkg --print-architecture").trim() @@ -149,6 +149,17 @@ pipeline { scp ${SSH_OPTS} build/vyos*.iso ${SSH_REMOTE}:${SSH_DIR}/ """ } + + setGitHubStatus("success", "Build has succeeded!") + } + } + failure { + script { + // only deploy ISO if build from official repository + if (isCustomBuild()) + return + + setGitHubStatus("failure", "Build has failed!") } } cleanup { |