Add cron job for closing pull requests.
Also move the launchpad sync cron into puppet. Create config file for github pull close script. This change depends on https://review.openstack.org/#change,224 Change-Id: I1b7ad599a6c7542614780ea0ce46a42a8995d15b Reviewed-on: https://review.openstack.org/225 Reviewed-by: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
2f9ad5a4d4
commit
f252d95d5c
@ -48,6 +48,13 @@ node "gerrit.openstack.org" {
|
||||
class { 'gerrit':
|
||||
canonicalweburl => "https://review.openstack.org/",
|
||||
email => "review@openstack.org",
|
||||
github_projects => [ {
|
||||
name => 'openstack/keystone',
|
||||
close_pull => 'true'
|
||||
}, {
|
||||
name => 'openstack/glance',
|
||||
close_pull => 'true'
|
||||
} ]
|
||||
}
|
||||
|
||||
class { 'iptables':
|
||||
@ -60,6 +67,10 @@ node "gerrit-dev.openstack.org" {
|
||||
class { 'gerrit':
|
||||
canonicalweburl => "https://review-dev.openstack.org/",
|
||||
email => "review-dev@openstack.org",
|
||||
github_projects => [ {
|
||||
name => 'gtest-org/gerrit',
|
||||
close_pull => 'true'
|
||||
} ]
|
||||
}
|
||||
|
||||
class { 'iptables':
|
||||
|
@ -1,14 +1,55 @@
|
||||
class gerrit($canonicalweburl='',
|
||||
$openidssourl="https://login.launchpad.net/+openid",
|
||||
$email='',
|
||||
$commentlinks = [ { name => 'launchpad',
|
||||
match => '([Bb]ug|[Ll][Pp])\\s*[#:]?\\s*(\\d+)',
|
||||
link => 'https://code.launchpad.net/bugs/$2' } ]
|
||||
) {
|
||||
$openidssourl="https://login.launchpad.net/+openid",
|
||||
$email='',
|
||||
$github_projects = [],
|
||||
$commentlinks = [ { name => 'launchpad',
|
||||
match => '([Bb]ug|[Ll][Pp])\\s*[#:]?\\s*(\\d+)',
|
||||
link => 'https://code.launchpad.net/bugs/$2' } ]
|
||||
) {
|
||||
|
||||
package { "python-dev":
|
||||
ensure => latest
|
||||
}
|
||||
package { "python-pip":
|
||||
ensure => latest,
|
||||
require => Package[python-dev]
|
||||
}
|
||||
package { "github2":
|
||||
ensure => latest,
|
||||
provider => pip,
|
||||
require => Package[python-pip]
|
||||
}
|
||||
|
||||
if $gerrit_installed {
|
||||
#notice('Gerrit is installed')
|
||||
|
||||
cron { "gerritupdateci":
|
||||
user => gerrit2,
|
||||
minute => "*/15",
|
||||
command => "sleep $((RANDOM%60)) && cd /home/gerrit2/openstack-ci && /usr/bin/git pull -q origin master"
|
||||
}
|
||||
|
||||
cron { "gerritsyncusers":
|
||||
user => gerrit2,
|
||||
minute => "*/15",
|
||||
command => "sleep $((RANDOM%60+60)) && cd /home/gerrit2/openstack-ci && python gerrit/update_gerrit_users.py"
|
||||
}
|
||||
|
||||
cron { "gerritclosepull":
|
||||
user => gerrit2,
|
||||
minute => "*/5",
|
||||
command => "sleep $((RANDOM%60+90)) && cd /home/gerrit2/openstack-ci && python gerrit/close_pull_requests.py"
|
||||
}
|
||||
|
||||
file { '/home/gerrit2/github.config':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 444,
|
||||
ensure => 'present',
|
||||
content => template('gerrit/github.config.erb'),
|
||||
replace => 'true',
|
||||
}
|
||||
|
||||
file { '/home/gerrit2/review_site/etc/replication.config':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
|
7
modules/gerrit/templates/github.config.erb
Normal file
7
modules/gerrit/templates/github.config.erb
Normal file
@ -0,0 +1,7 @@
|
||||
# This file is managed by puppet.
|
||||
# https://github.com/openstack/openstack-ci-puppet
|
||||
|
||||
<% github_projects.each do |project| -%>
|
||||
[project "<%= project['name'] %>"]
|
||||
close_pull = <%= project['close_pull'] %>
|
||||
<% end -%>
|
Loading…
Reference in New Issue
Block a user