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
modules
gerrit
openstack_project/manifests

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

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

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

@ -53,7 +53,6 @@ class openstack_project::review (
$lp_sync_secret='', $lp_sync_secret='',
$contactstore_appsec='', $contactstore_appsec='',
$contactstore_pubkey='', $contactstore_pubkey='',
$replicate_github=true,
$sysadmins = [], $sysadmins = [],
$swift_username = '', $swift_username = '',
$swift_password = '' $swift_password = ''
@ -102,11 +101,34 @@ class openstack_project::review (
mysql_root_password => $mysql_root_password, mysql_root_password => $mysql_root_password,
trivial_rebase_role_id => 'trivial-rebase@review.openstack.org', trivial_rebase_role_id => 'trivial-rebase@review.openstack.org',
email_private_key => $email_private_key, email_private_key => $email_private_key,
replicate_github => $replicate_github,
sysadmins => $sysadmins, sysadmins => $sysadmins,
swift_username => $swift_username, swift_username => $swift_username,
swift_password => $swift_password, 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': class { 'gerritbot':
nick => 'openstackgerrit', nick => 'openstackgerrit',
password => $gerritbot_password, password => $gerritbot_password,

@ -20,7 +20,6 @@ class openstack_project::review_dev (
$lp_sync_consumer_key = '', $lp_sync_consumer_key = '',
$lp_sync_token = '', $lp_sync_token = '',
$lp_sync_secret = '', $lp_sync_secret = '',
$replicate_github = true,
$sysadmins = [], $sysadmins = [],
$swift_username = '', $swift_username = '',
$swift_password = '' $swift_password = ''
@ -59,10 +58,25 @@ class openstack_project::review_dev (
trivial_rebase_role_id => trivial_rebase_role_id =>
'trivial-rebase@review-dev.openstack.org', 'trivial-rebase@review-dev.openstack.org',
email_private_key => $email_private_key, email_private_key => $email_private_key,
replicate_github => $replicate_github,
sysadmins => $sysadmins, sysadmins => $sysadmins,
swift_username => $swift_username, swift_username => $swift_username,
swift_password => $swift_password, 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': file { '/var/log/gerrit_user_sync':