diff --git a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy index 438a10e5c..44b2e8083 100644 --- a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy +++ b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy @@ -482,6 +482,9 @@ class KogitoJobTemplate { scriptPath(jenkinsFilePath) } } + configure { + it / disabled << Utils.isPrCheckDisabled(script) + } branchSources { github { id(Utils.getRepoName(script)) // IMPORTANT: use a constant and unique identifier diff --git a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy index c11b65f35..14ce74d1f 100644 --- a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy +++ b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy @@ -283,4 +283,8 @@ class Utils { return getBindingValue(script, 'DISABLE_DEPLOY').toBoolean() || isTestEnvironment(script) } + static boolean isPrCheckDisabled(def script) { + return getBindingValue(script, 'DISABLE_PR_CHECK').toBoolean() || isTestEnvironment(script) + } + }