Configure its-storyboard plugin
Add configurations for the its-storyboard plugin: 1. Move java_home variable to a higher level module so it can be used to install certificate on review-dev.o.o 2. Configure its-storyboard for review.o.o and review-dev.o.o 3. Associate review.o.o with storyboard.o.o and review-dev.o.o with storyboard-dev.o.o 4. Import ssl certificate to java on review-dev.o.o so that the plugin can POST updates to storyboard-dev.o.o using storyboard REST APIs. 5. Configure rules (or conditions) telling its-plugin to update storyboard tasks status on specific gerrit change updates. Gerrit change to storyboard task transition mapping: change abandoned -> SB task set to 'todo' change createed or change restored -> SB task set to 'review' change merged -> SB task set to 'merged' Change-Id: Id6ec16e267fca5fbbc42b1d3547fc5d2fa4c671b depends-on: I9f47a2ed88ffbe827e494a478c0dc89a08bbe370 depends-on: I5e817fab8a8973b688fd44dd819e3616df171321
This commit is contained in:
parent
c8dcc011f1
commit
f1ca18ebfd
@ -59,6 +59,7 @@ node 'review.openstack.org' {
|
|||||||
contactstore_pubkey => hiera('gerrit_contactstore_pubkey'),
|
contactstore_pubkey => hiera('gerrit_contactstore_pubkey'),
|
||||||
swift_username => hiera('swift_store_user', 'username'),
|
swift_username => hiera('swift_store_user', 'username'),
|
||||||
swift_password => hiera('swift_store_key'),
|
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_consumer_key => hiera('gerrit_dev_lp_consumer_key'),
|
||||||
lp_sync_token => hiera('gerrit_dev_lp_access_token'),
|
lp_sync_token => hiera('gerrit_dev_lp_access_token'),
|
||||||
lp_sync_secret => hiera('gerrit_dev_lp_access_secret'),
|
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'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +81,9 @@ class openstack_project::gerrit (
|
|||||||
$receive_max_object_size_limit = '100 m',
|
$receive_max_object_size_limit = '100 m',
|
||||||
$commentlinks = [],
|
$commentlinks = [],
|
||||||
$commitmessage_params = {},
|
$commitmessage_params = {},
|
||||||
|
$its_plugins = [],
|
||||||
|
$its_rules = [],
|
||||||
|
$java_home = '',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
class { 'jeepyb::openstackwatch':
|
class { 'jeepyb::openstackwatch':
|
||||||
@ -119,6 +122,7 @@ class openstack_project::gerrit (
|
|||||||
robots_txt_source => 'puppet:///modules/openstack_project/gerrit/robots.txt',
|
robots_txt_source => 'puppet:///modules/openstack_project/gerrit/robots.txt',
|
||||||
enable_javamelody_top_menu => false,
|
enable_javamelody_top_menu => false,
|
||||||
# passthrough
|
# passthrough
|
||||||
|
java_home => $java_home,
|
||||||
ssl_cert_file => $ssl_cert_file,
|
ssl_cert_file => $ssl_cert_file,
|
||||||
ssl_key_file => $ssl_key_file,
|
ssl_key_file => $ssl_key_file,
|
||||||
ssl_chain_file => $ssl_chain_file,
|
ssl_chain_file => $ssl_chain_file,
|
||||||
@ -147,6 +151,8 @@ class openstack_project::gerrit (
|
|||||||
httpd_maxqueued => $httpd_maxqueued,
|
httpd_maxqueued => $httpd_maxqueued,
|
||||||
httpd_maxwait => $httpd_maxwait,
|
httpd_maxwait => $httpd_maxwait,
|
||||||
commentlinks => $commentlinks,
|
commentlinks => $commentlinks,
|
||||||
|
its_plugins => $its_plugins,
|
||||||
|
its_rules => $its_rules,
|
||||||
trackingids => [
|
trackingids => [
|
||||||
{
|
{
|
||||||
name => 'storyboard',
|
name => 'storyboard',
|
||||||
|
@ -83,15 +83,22 @@ class openstack_project::review (
|
|||||||
# For openstackwatch.
|
# For openstackwatch.
|
||||||
$swift_username = '',
|
$swift_username = '',
|
||||||
$swift_password = '',
|
$swift_password = '',
|
||||||
|
$storyboard_password = '',
|
||||||
$project_config_repo = '',
|
$project_config_repo = '',
|
||||||
$projects_config = 'openstack_project/review.projects.ini.erb',
|
$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':
|
class { 'project_config':
|
||||||
url => $project_config_repo,
|
url => $project_config_repo,
|
||||||
}
|
}
|
||||||
|
|
||||||
class { 'openstack_project::gerrit':
|
class { 'openstack_project::gerrit':
|
||||||
|
java_home => $java_home,
|
||||||
git_http_url => 'https://git.openstack.org/',
|
git_http_url => 'https://git.openstack.org/',
|
||||||
canonical_git_url => 'git://git.openstack.org/',
|
canonical_git_url => 'git://git.openstack.org/',
|
||||||
ssl_cert_file => $ssl_cert_file,
|
ssl_cert_file => $ssl_cert_file,
|
||||||
@ -157,6 +164,11 @@ class openstack_project::review (
|
|||||||
match => '\\b[Ss]tory:? #?(\\d+)',
|
match => '\\b[Ss]tory:? #?(\\d+)',
|
||||||
link => 'https://storyboard.openstack.org/#!/story/$1',
|
link => 'https://storyboard.openstack.org/#!/story/$1',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name => 'its-storyboard',
|
||||||
|
match => '\\b[Tt]ask:? #?(\\d+)',
|
||||||
|
link => 'task: $1',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name => 'blueprint',
|
name => 'blueprint',
|
||||||
match => '(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)',
|
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',
|
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 => {
|
download => {
|
||||||
'command' => ['checkout', 'cherry_pick', 'pull', 'format_patch'],
|
'command' => ['checkout', 'cherry_pick', 'pull', 'format_patch'],
|
||||||
'scheme' => ['ssh', 'anon_http', 'anon_git'],
|
'scheme' => ['ssh', 'anon_http', 'anon_git'],
|
||||||
|
@ -24,10 +24,17 @@ class openstack_project::review_dev (
|
|||||||
$lp_sync_secret = '',
|
$lp_sync_secret = '',
|
||||||
$swift_username = '',
|
$swift_username = '',
|
||||||
$swift_password = '',
|
$swift_password = '',
|
||||||
|
$storyboard_password = '',
|
||||||
|
$storyboard_ssl_cert = '',
|
||||||
$project_config_repo = '',
|
$project_config_repo = '',
|
||||||
$projects_config = 'openstack_project/review-dev.projects.ini.erb',
|
$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 (
|
realize (
|
||||||
User::Virtual::Localuser['zaro'],
|
User::Virtual::Localuser['zaro'],
|
||||||
)
|
)
|
||||||
@ -93,6 +100,11 @@ class openstack_project::review_dev (
|
|||||||
match => '\\b[Ss]tory:? #?(\\d+)',
|
match => '\\b[Ss]tory:? #?(\\d+)',
|
||||||
link => 'https://storyboard-dev.openstack.org/#!/story/$1',
|
link => 'https://storyboard-dev.openstack.org/#!/story/$1',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name => 'its-storyboard',
|
||||||
|
match => '\\b[Tt]ask:? #?(\\d+)',
|
||||||
|
link => 'task: $1',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name => 'blueprint',
|
name => 'blueprint',
|
||||||
match => '(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)',
|
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',
|
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 => [
|
replication => [
|
||||||
{
|
{
|
||||||
name => 'github',
|
name => 'github',
|
||||||
@ -149,6 +179,29 @@ class openstack_project::review_dev (
|
|||||||
gerrit::plugin { 'javamelody': version => '3fefa35' }
|
gerrit::plugin { 'javamelody': version => '3fefa35' }
|
||||||
gerrit::plugin { 'delete-project': version => '4b7410c' }
|
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':
|
package { 'python-launchpadlib':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user