diff --git a/.jenkins/common_job_properties.groovy b/.jenkins/common_job_properties.groovy index f3a8a07952a0..a27e59f3c8a9 100644 --- a/.jenkins/common_job_properties.groovy +++ b/.jenkins/common_job_properties.groovy @@ -81,6 +81,7 @@ class common_job_properties { // Sets the pull request build trigger. static def setPullRequestBuildTrigger(def context, + def branchWhitelist, def commitStatusContext, def successComment = '--none--') { context.triggers { @@ -88,6 +89,7 @@ class common_job_properties { admins(['asfbot']) useGitHubHooks() orgWhitelist(['apache']) + whiteListTargetBranches(branchWhitelist) allowMembersOfWhitelistedOrgsAsAdmin() permitAll() @@ -140,9 +142,9 @@ class common_job_properties { } // Sets common config for PreCommit jobs. - static def setPreCommit(def context, comment) { + static def setPreCommit(def context, branches, comment) { // Set pull request build trigger. - setPullRequestBuildTrigger(context, comment) + setPullRequestBuildTrigger(context, branches, comment) } // Sets common config for PostCommit jobs. diff --git a/.jenkins/job_beam_PreCommit_Java_MavenInstall.groovy b/.jenkins/job_beam_PreCommit_Java_MavenInstall.groovy index 8a8dea573f4d..726f12366ac8 100644 --- a/.jenkins/job_beam_PreCommit_Java_MavenInstall.groovy +++ b/.jenkins/job_beam_PreCommit_Java_MavenInstall.groovy @@ -35,7 +35,7 @@ mavenJob('beam_PreCommit_Java_MavenInstall') { common_job_properties.setMavenConfig(delegate) // Sets that this is a PreCommit job. - common_job_properties.setPreCommit(delegate, 'Jenkins: Maven clean install') + common_job_properties.setPreCommit(delegate, ['master'], 'Jenkins: Maven clean install') // Maven goals for this job. goals('-B -e -Prelease,include-runners,jenkins-precommit,direct-runner,dataflow-runner,spark-runner,flink-runner,apex-runner help:effective-settings clean install') diff --git a/.jenkins/job_beam_PreCommit_Python_MavenInstall.groovy b/.jenkins/job_beam_PreCommit_Python_MavenInstall.groovy new file mode 100644 index 000000000000..84701ad77cde --- /dev/null +++ b/.jenkins/job_beam_PreCommit_Python_MavenInstall.groovy @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import common_job_properties + +// This job defines the Python precommit which runs a maven install on python-sdk branch. +mavenjob('beam_PreCommit_Python_MavenInstall') { + description('Runs an maven install on the python-sdk branch.') + + previousNames('beam_PreCommit_MavenVerify') + + // Execute concurrent builds if necessary. + concurrentBuild() + + // Set common parameters. + common_job_properties.setTopLevelJobProperties(delegate, 'python-sdk') + + // Sets that this is a PreCommit job. + common_job_properties.setPreCommit(delegate, ['python-sdk'], 'Jenkins: Python PreCommit') + + // Maven goals for this job. + goals('-B -e help:effective-settings clean install') +}