Jenkinsfile: prevent PRs to master

I just merged a PR to master by mistake. Whoops! Let's not let that happen again.
coolant-mod
krzys-h 2017-05-29 21:08:51 +02:00
parent 3cf809d6a3
commit f4c4364f00
1 changed files with 4 additions and 0 deletions

4
Jenkinsfile vendored
View File

@ -5,6 +5,10 @@ if (env.BRANCH_NAME.startsWith('PR-')) {
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '5']]])
}
if (env.CHANGE_TARGET == 'master') {
error("This pull request targets the wrong branch. Please reopen the pull request targetting the dev branch.")
}
node('master') {
stage('Pull changes') {
checkout scm