From 9609169903d5a1a259e943b6ac31702bffc18ab9 Mon Sep 17 00:00:00 2001 From: Paulo Tada Date: Wed, 16 Dec 2015 11:43:23 -0200 Subject: [PATCH] Adding the plugin of mezuro for colab integration --- cookbooks/colab/recipes/default.rb | 7 +++++++ cookbooks/colab/templates/mezuro.py.erb | 28 ++++++++++++++++++++++++++++ cookbooks/mezuro/recipes/prezento.rb | 15 +++++++++++++++ 3 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 cookbooks/colab/templates/mezuro.py.erb diff --git a/cookbooks/colab/recipes/default.rb b/cookbooks/colab/recipes/default.rb index fe91b63..d86c847 100644 --- a/cookbooks/colab/recipes/default.rb +++ b/cookbooks/colab/recipes/default.rb @@ -165,6 +165,13 @@ template '/etc/colab/plugins.d/sentry_client.py' do notifies :restart, 'service[colab]' end +template '/etc/colab/plugins.d/mezuro.py' do + owner 'root' + group 'colab' + mode 0640 + notifies :restart, 'service[colab]' +end + execute 'colab-admin migrate' # Static files diff --git a/cookbooks/colab/templates/mezuro.py.erb b/cookbooks/colab/templates/mezuro.py.erb new file mode 100644 index 0000000..260d0b8 --- /dev/null +++ b/cookbooks/colab/templates/mezuro.py.erb @@ -0,0 +1,28 @@ +from django.utils.translation import ugettext_lazy as _ +from colab.plugins.utils.menu import colab_url_factory + +name = 'colab_mezuro' +verbose_name = 'Mezuro Plugin' + +upstream = 'http://<%= node['peers']['integration'] %>:8081/mezuro/' +#middlewares = [] + +urls = { + 'include': 'colab_mezuro.urls', + 'prefix': '^mezuro/', +} + +menu_title = _('Code Quality') + +url = colab_url_factory('mezuro') + +menu_urls = ( + url(display=_('Projects'), viewname='mezuro', + kwargs={'path': 'projects'}, auth=False), + url(display=_('Repositories'), viewname='mezuro', + kwargs={'path': 'repositories'}, auth=False), + url(display=_('Configurations'), viewname='mezuro', + kwargs={'path': 'kalibro_configurations'}, auth=False), + url(display=_('Reading Groups'), viewname='mezuro', + kwargs={'path': 'reading_groups'}, auth=False), +) diff --git a/cookbooks/mezuro/recipes/prezento.rb b/cookbooks/mezuro/recipes/prezento.rb index 5fec9ea..231636f 100644 --- a/cookbooks/mezuro/recipes/prezento.rb +++ b/cookbooks/mezuro/recipes/prezento.rb @@ -34,3 +34,18 @@ execute 'prezento:migrate' do notifies :restart, 'service[prezento.target]' end +############################################################################# +# The next lines install the mezuro plugin for colab intergration # +# This shold be removed when the plugin were install thought pkg colab-deps # +############################################################################# + +git '/home/vagrant/colab-mezuro-plugin' do + repository 'https://github.com/colab/colab-mezuro-plugin.git' + revision 'master' +end + +execute 'pip:install:plugin' do + command '/usr/lib/colab/bin/pip install .' + cwd '/home/vagrant/colab-mezuro-plugin' + user 'root' +end -- libgit2 0.21.2