Merge "Add replication of git from gerrit to git.o.o"

This commit is contained in:
Jenkins 2013-08-08 02:28:41 +00:00 committed by Gerrit Code Review
commit ce7722da89
5 changed files with 60 additions and 22 deletions

View File

@ -56,8 +56,6 @@
# A public key with which to encrypt contact information
# contactstore_url:
# A URL for the remote contact store application
# replicate_github:
# A boolean enabling replication to github
# replicate_local:
# A boolean enabling local replication for apache acceleration
# gitweb:
@ -108,8 +106,8 @@ class gerrit(
$contactstore_url = '',
$enable_melody = false,
$melody_session = false,
$replicate_github = false,
$replicate_local = false,
$replication = [],
$replication_targets = [],
$gitweb = true,
$testmode = false

View File

@ -1,18 +1,22 @@
# This file is managed by puppet.
# https://github.com/openstack-infra/config
<% if replicate_github -%>
[remote "github"]
url = git@github.com:${name}.git
authGroup = Anonymous Users
replicatePermissions = false
mirror = true
<% replication.each do |replication| -%>
[remote "<%= replication['name'] %>"]
url = <%= replication['url'] %>${name}.git
<% if replication['replicationDelay'] != nil -%>
replicationDelay = <%= replication['replicationDelay'] %>
<% end -%>
<% if replication['threads'] != nil -%>
threads = <%= replication['threads'] %>
<% end -%>
<% if replication['authGroup'] != nil -%>
authGroup = <%= replication['authGroup'] %>
<% end -%>
<% if replication['replicatePermissions'] != nil -%>
replicatePermissions = <%= replication['replicatePermissions'] %>
<% end -%>
<% if replication['mirror'] != nil -%>
mirror = <%= replication['mirror'] %>
<% end -%>
<% if replicate_local -%>
[remote "local"]
url = file:///var/lib/git/${name}.git
replicationDelay = 0
threads = 4
mirror = true
<% end -%>

View File

@ -49,8 +49,8 @@ class openstack_project::gerrit (
$mysql_root_password = '',
$trivial_rebase_role_id = '',
$email_private_key = '',
$replicate_github = true,
$replicate_local = true,
$replication = [],
$local_git_dir = '/var/lib/git',
$cla_description = 'OpenStack Individual Contributor License Agreement',
$cla_file = 'static/cla.html',
@ -148,8 +148,8 @@ class openstack_project::gerrit (
mysql_password => $mysql_password,
mysql_root_password => $mysql_root_password,
email_private_key => $email_private_key,
replicate_github => $replicate_github,
replicate_local => $replicate_local,
replication => $replication,
testmode => $testmode,
require => Class[openstack_project::server],
}

View File

@ -53,7 +53,6 @@ class openstack_project::review (
$lp_sync_secret='',
$contactstore_appsec='',
$contactstore_pubkey='',
$replicate_github=true,
$sysadmins = [],
$swift_username = '',
$swift_password = ''
@ -102,11 +101,34 @@ class openstack_project::review (
mysql_root_password => $mysql_root_password,
trivial_rebase_role_id => 'trivial-rebase@review.openstack.org',
email_private_key => $email_private_key,
replicate_github => $replicate_github,
sysadmins => $sysadmins,
swift_username => $swift_username,
swift_password => $swift_password,
replication => [
{
name => 'github',
url => 'git@github.com:',
authGroup => 'Anonymous Users',
replicatePermissions => false,
mirror => true,
},
{
name => 'local',
url => 'file:///var/lib/git/',
replicationDelay => '0',
threads => '4',
mirror => true,
},
{
name => 'cgit',
url => 'cgit@git.openstack.org:/var/lib/git/',
replicationDelay => '0',
threads => '4',
mirror => true,
},
],
}
class { 'gerritbot':
nick => 'openstackgerrit',
password => $gerritbot_password,

View File

@ -20,7 +20,6 @@ class openstack_project::review_dev (
$lp_sync_consumer_key = '',
$lp_sync_token = '',
$lp_sync_secret = '',
$replicate_github = true,
$sysadmins = [],
$swift_username = '',
$swift_password = ''
@ -59,10 +58,25 @@ class openstack_project::review_dev (
trivial_rebase_role_id =>
'trivial-rebase@review-dev.openstack.org',
email_private_key => $email_private_key,
replicate_github => $replicate_github,
sysadmins => $sysadmins,
swift_username => $swift_username,
swift_password => $swift_password,
replication => [
{
name => 'github',
url => 'git@github.com:',
authGroup => 'Anonymous Users',
replicatePermissions => false,
mirror => true,
},
{
name => 'local',
url => 'file:///var/lib/git/',
replicationDelay => '0',
threads => '4',
mirror => true,
},
],
}
file { '/var/log/gerrit_user_sync':