From: Timo Heister Date: Tue, 5 Feb 2019 23:02:13 +0000 (-0700) Subject: [CI]: add Jenkins.mark X-Git-Tag: v9.1.0-rc1~363^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f809d49183e94d267d5ec0a71ffd6c4ff328adfb;p=dealii.git [CI]: add Jenkins.mark Add a separate Jenkins pipeline that runs in a few seconds to set the commit status to pending. This is needed as Jenkins only starts setting a commit status when the normal jobs start running and not when they are in the queue. This can lead to a) accidental merges before we test things and b) repeated /rebuild triggers. --- diff --git a/Jenkinsfile b/Jenkinsfile index 09370d793b..9e3e48848f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,6 +42,9 @@ pipeline { steps { + // we are finally running, so we can mark the 'ready' context from Jenkinsfile.mark as success: + githubNotify context: 'ready', description: ':-)', status: 'SUCCESS' + // We can not use 'indent' because we are missing the master branch: // "fatal: ambiguous argument 'master': unknown revision or path" sh ''' diff --git a/contrib/ci/Jenkinsfile.mark b/contrib/ci/Jenkinsfile.mark new file mode 100644 index 0000000000..c10638a513 --- /dev/null +++ b/contrib/ci/Jenkinsfile.mark @@ -0,0 +1,51 @@ +#!groovy + +// This Jenkinsfile is used to mark jobs as "pending" as quickly as +// possible. The other longer running jobs only set the status to pending once +// they start running. +// +// See https://jenkins.tjhei.info/job/dealii-mark/ for details. + +/* +Settings to apply inside Jenkins: + - discover pull requests (remove branches/master) + - Strategy: merged PR + - enable "Disable GitHub Multibranch Status Plugin" + - trigger build on pull request comment: .* /rebuild.* (without space) + - Jenkinsfile: choose contrib/ci/Jenkinsfile.mark + - scan: every 4 hours + - discard: 5+ items + - docker label: small +*/ + +pipeline +{ + agent none + + stages + { + stage("check") + { + steps + { + githubNotify context: 'ready', description: 'please be patient, testers are spinning up...', status: 'PENDING' + sh ''' + wget -q -O - https://api.github.com/repos/dealii/dealii/issues/${CHANGE_ID}/labels | grep 'ready to test' || \ + { echo "This commit will only be tested when it has the label 'ready to test'. Trigger a rebuild by adding a comment that contains '/rebuild'..."; exit 1; } + ''' + } + post + { + failure + { + githubNotify context: 'ready', description: 'need ready to test label and /rebuild', status: 'PENDING' + script + { + currentBuild.result='NOT_BUILT' + } + } + } + } + + } +}