Website Mergebot Job Signed-off-by: Jason Kuster <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/f2c337cc Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/f2c337cc Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/f2c337cc Branch: refs/heads/DSL_SQL Commit: f2c337cc006101de050781a50ee70ad940dbf28e Parents: a32db07 Author: Jason Kuster <[email protected]> Authored: Fri Jun 9 01:39:15 2017 -0700 Committer: Tyler Akidau <[email protected]> Committed: Wed Jul 12 20:00:59 2017 -0700 ---------------------------------------------------------------------- .../jenkins/common_job_properties.groovy | 5 +- .../job_beam_PreCommit_Website_Merge.groovy | 59 ++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/f2c337cc/.test-infra/jenkins/common_job_properties.groovy ---------------------------------------------------------------------- diff --git a/.test-infra/jenkins/common_job_properties.groovy b/.test-infra/jenkins/common_job_properties.groovy index 0e047ea..70534c6 100644 --- a/.test-infra/jenkins/common_job_properties.groovy +++ b/.test-infra/jenkins/common_job_properties.groovy @@ -23,11 +23,12 @@ class common_job_properties { // Sets common top-level job properties for website repository jobs. - static void setTopLevelWebsiteJobProperties(context) { + static void setTopLevelWebsiteJobProperties(context, + String branch = 'asf-site') { setTopLevelJobProperties( context, 'beam-site', - 'asf-site', + branch, 'beam', 30) } http://git-wip-us.apache.org/repos/asf/beam/blob/f2c337cc/.test-infra/jenkins/job_beam_PreCommit_Website_Merge.groovy ---------------------------------------------------------------------- diff --git a/.test-infra/jenkins/job_beam_PreCommit_Website_Merge.groovy b/.test-infra/jenkins/job_beam_PreCommit_Website_Merge.groovy new file mode 100644 index 0000000..0e2ae3f --- /dev/null +++ b/.test-infra/jenkins/job_beam_PreCommit_Website_Merge.groovy @@ -0,0 +1,59 @@ +/* + * 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 + +// Defines a job. +job('beam_PreCommit_Website_Merge') { + description('Runs website tests for mergebot.') + + // Set common parameters. + common_job_properties.setTopLevelWebsiteJobProperties(delegate, 'mergebot') + + triggers { + githubPush() + } + + steps { + // Run the following shell script as a build step. + shell ''' + # Install RVM per instructions at https://rvm.io/rvm/install. + RVM_GPG_KEY=409B6B1796C275462A1703113804BB82D39DC0E3 + gpg --keyserver hkp://keys.gnupg.net --recv-keys $RVM_GPG_KEY + + \\curl -sSL https://get.rvm.io | bash + source /home/jenkins/.rvm/scripts/rvm + + # Install Ruby. + RUBY_VERSION_NUM=2.3.0 + rvm install ruby $RUBY_VERSION_NUM --autolibs=read-only + + # Install Bundler gem + PATH=~/.gem/ruby/$RUBY_VERSION_NUM/bin:$PATH + GEM_PATH=~/.gem/ruby/$RUBY_VERSION_NUM/:$GEM_PATH + gem install bundler --user-install + + # Install all needed gems. + bundle install --path ~/.gem/ + + # Build the new site and test it. + rm -fr ./content/ + bundle exec rake test + '''.stripIndent().trim() + } +}
