Merge "Configure its-storyboard plugin"

This commit is contained in:
Jenkins 2016-08-03 16:39:45 +00:00 committed by Gerrit Code Review
commit aecd99ff32
4 changed files with 98 additions and 0 deletions

View File

@ -59,6 +59,7 @@ node 'review.openstack.org' {
contactstore_pubkey => hiera('gerrit_contactstore_pubkey'),
swift_username => hiera('swift_store_user', 'username'),
swift_password => hiera('swift_store_key'),
storyboard_password => hiera('gerrit_storyboard_token'),
}
}
@ -91,6 +92,8 @@ node 'review-dev.openstack.org' {
lp_sync_consumer_key => hiera('gerrit_dev_lp_consumer_key'),
lp_sync_token => hiera('gerrit_dev_lp_access_token'),
lp_sync_secret => hiera('gerrit_dev_lp_access_secret'),
storyboard_password => hiera('gerrit_dev_storyboard_token'),
storyboard_ssl_cert => hiera('gerrit_dev_storyboard_ssl_crt'),
}
}

View File

@ -81,6 +81,9 @@ class openstack_project::gerrit (
$receive_max_object_size_limit = '100 m',
$commentlinks = [],
$commitmessage_params = {},
$its_plugins = [],
$its_rules = [],
$java_home = '',
) {
class { 'jeepyb::openstackwatch':
@ -119,6 +122,7 @@ class openstack_project::gerrit (
robots_txt_source => 'puppet:///modules/openstack_project/gerrit/robots.txt',
enable_javamelody_top_menu => false,
# passthrough
java_home => $java_home,
ssl_cert_file => $ssl_cert_file,
ssl_key_file => $ssl_key_file,
ssl_chain_file => $ssl_chain_file,
@ -147,6 +151,8 @@ class openstack_project::gerrit (
httpd_maxqueued => $httpd_maxqueued,
httpd_maxwait => $httpd_maxwait,
commentlinks => $commentlinks,
its_plugins => $its_plugins,
its_rules => $its_rules,
trackingids => [
{
name => 'storyboard',

View File

@ -83,15 +83,22 @@ class openstack_project::review (
# For openstackwatch.
$swift_username = '',
$swift_password = '',
$storyboard_password = '',
$project_config_repo = '',
$projects_config = 'openstack_project/review.projects.ini.erb',
) {
$java_home = $::lsbdistcodename ? {
'precise' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
'trusty' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
}
class { 'project_config':
url => $project_config_repo,
}
class { 'openstack_project::gerrit':
java_home => $java_home,
git_http_url => 'https://git.openstack.org/',
canonical_git_url => 'git://git.openstack.org/',
ssl_cert_file => $ssl_cert_file,
@ -157,6 +164,11 @@ class openstack_project::review (
match => '\\b[Ss]tory:? #?(\\d+)',
link => 'https://storyboard.openstack.org/#!/story/$1',
},
{
name => 'its-storyboard',
match => '\\b[Tt]ask:? #?(\\d+)',
link => 'task: $1',
},
{
name => 'blueprint',
match => '(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)',
@ -183,6 +195,30 @@ class openstack_project::review (
html => '$1<a href=\"/#q,$2,n,z\">$2</a>$3',
},
],
its_plugins => [
{
name => 'its-storyboard',
password => $storyboard_password,
url => 'https://storyboard.openstack.org',
},
],
its_rules => [
{
name => 'change_abandoned',
event_type => 'change-abandoned',
action => 'set-status TODO',
},
{
name => 'change_in_progress',
event_type => 'patchset-created, change-restored',
action => 'set-status REVIEW',
},
{
name => 'change_merged',
event_type => 'change-merged',
action => 'set-status MERGED',
},
],
download => {
'command' => ['checkout', 'cherry_pick', 'pull', 'format_patch'],
'scheme' => ['ssh', 'anon_http', 'anon_git'],

View File

@ -24,10 +24,17 @@ class openstack_project::review_dev (
$lp_sync_secret = '',
$swift_username = '',
$swift_password = '',
$storyboard_password = '',
$storyboard_ssl_cert = '',
$project_config_repo = '',
$projects_config = 'openstack_project/review-dev.projects.ini.erb',
) {
$java_home = $::lsbdistcodename ? {
'precise' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
'trusty' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
}
realize (
User::Virtual::Localuser['zaro'],
)
@ -93,6 +100,11 @@ class openstack_project::review_dev (
match => '\\b[Ss]tory:? #?(\\d+)',
link => 'https://storyboard-dev.openstack.org/#!/story/$1',
},
{
name => 'its-storyboard',
match => '\\b[Tt]ask:? #?(\\d+)',
link => 'task: $1',
},
{
name => 'blueprint',
match => '(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)',
@ -119,6 +131,24 @@ class openstack_project::review_dev (
html => '$1<a href=\"/#q,$2,n,z\">$2</a>$3',
},
],
its_plugins => [
{
name => 'its-storyboard',
password => $storyboard_password,
url => 'https://storyboard-dev.openstack.org',
},
],
its_rules => [
{
name => 'LOG',
action => 'log-event error',
},
{
name => 'change_status_updates',
event_type => 'patchset-created,change-abandoned,change-restored,change-merged',
action => 'add-standard-comment',
},
],
replication => [
{
name => 'github',
@ -149,6 +179,29 @@ class openstack_project::review_dev (
gerrit::plugin { 'javamelody': version => '3fefa35' }
gerrit::plugin { 'delete-project': version => '4b7410c' }
# create a file containing the ssl certificate
file { '/home/gerrit2/storyboard-dev.crt':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0600',
content => $storyboard_ssl_cert,
replace => true,
require => User['gerrit2'],
}
# Import certificate to java to allow gerrit its plugins to POST to storyboard
exec { 'import-java-certs':
user => 'root',
command => "keytool -import -alias storyboard-dev.openstack.org -keystore $java_home/lib/security/cacerts -file /home/gerrit2/storyboard-dev.crt -storepass secret -noprompt",
unless => "keytool -list -alias storyboard-dev.openstack.org -storepass secret -keystore $java_home/lib/security/cacerts >/dev/null 2>&1",
path => '/bin:/usr/bin',
require => [
Package['openjdk-7-jre-headless'],
File['/home/gerrit2/storyboard-dev.crt'],
],
}
package { 'python-launchpadlib':
ensure => present,
}