Merge "Allow puppet to configure gerrit commitmessage parameters"

This commit is contained in:
Jenkins 2016-07-20 17:59:38 +00:00 committed by Gerrit Code Review
commit 4d559ab5ca
3 changed files with 25 additions and 0 deletions

View File

@ -129,6 +129,14 @@
# 'scheme' => ['ssh', 'anon_http', 'anon_git'],
# 'archive' => ['tar', 'tbz2', 'tgz', 'txz'],
# },
# commitmessage_params:
# A dict of commit message parameters, valid params are: maxLineLength,
# longLinesThreshold, rejectTooLong, and maxSubjectLength.
# Example:
# commitmessage_params => {
# maxSubjectLength => '60',
# maxLineLength => '72',
# },
# java_home:
# The path to java home directory
# TODO: make more gerrit options configurable here
@ -227,6 +235,7 @@ class gerrit(
$cache_diff_timeout = '',
$cache_diff_intraline_timeout = '',
$download = {},
$commitmessage_params = {},
$java_home = '/usr/lib/jvm/java-7-openjdk-amd64/jre',
) {
include ::httpd
@ -407,6 +416,7 @@ class gerrit(
# - $cache_diff_timeout
# - $cache_diff_intraline_timeout
# - $download
# - $commitmessage_params
file { '/home/gerrit2/review_site/etc/gerrit.config':
ensure => present,

View File

@ -33,6 +33,13 @@ class { '::gerrit':
ssh_replication_rsa_pubkey_contents => file('/tmp/gerrit-ssh-keys/ssh_replication_rsa_key.pub'),
secondary_index => true,
secondary_index_type => 'LUCENE',
commitmessage_params =>
{
maxSubjectLength => '60',
maxLineLength => '72',
longLinesThreshold => '20',
rejectTooLong => 'true',
},
}
class { '::gerrit::cron': }

View File

@ -193,6 +193,14 @@
<% end -%>
<% end -%>
<% end -%>
<% unless @commitmessage_params.nil? or @commitmessage_params.empty? -%>
[commitmessage]
<% @commitmessage_params.each do |key, value| -%>
<% if key == "maxLineLength" or key == "longLinesThreshold" or key == "rejectTooLong" or key == "maxSubjectLength" -%>
<%= key %> = <%= value %>
<% end -%>
<% end -%>
<% end -%>
[groups]
newGroupsVisibleToAll = <%= @new_groups_visible_to_all %>
[mimetype "image/*"]