Commit ca5798498cca88298fbd724100cb1e32be54134f

Authored by Paulo Tada
Committed by Rafael Manzo
1 parent 42711377
Exists in mezuro_cookbook

Adding the plugin of mezuro for colab integration

The plugin are installed manualy in cookbooks/mezuro/recipes/prezento.rb
This should be doing by the package colab-deps
cookbooks/colab/recipes/default.rb
... ... @@ -175,6 +175,13 @@ template '/etc/colab/plugins.d/sentry_client.py' do
175 175 notifies :restart, 'service[colab]'
176 176 end
177 177  
  178 +template '/etc/colab/plugins.d/mezuro.py' do
  179 + owner 'root'
  180 + group 'colab'
  181 + mode 0640
  182 + notifies :restart, 'service[colab]'
  183 +end
  184 +
178 185 execute 'colab-admin migrate'
179 186  
180 187 # Adding widgets for colab
... ...
cookbooks/colab/templates/mezuro.py.erb 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +from django.utils.translation import ugettext_lazy as _
  2 +from colab.plugins.utils.menu import colab_url_factory
  3 +
  4 +name = 'colab_mezuro'
  5 +verbose_name = 'Mezuro Plugin'
  6 +
  7 +upstream = 'http://<%= node['peers']['integration'] %>:8081/mezuro/'
  8 +#middlewares = []
  9 +
  10 +urls = {
  11 + 'include': 'colab_mezuro.urls',
  12 + 'prefix': '^mezuro/',
  13 +}
  14 +
  15 +menu_title = _('Code Quality')
  16 +
  17 +url = colab_url_factory('mezuro')
  18 +
  19 +menu_urls = (
  20 + url(display=_('Projects'), viewname='mezuro',
  21 + kwargs={'path': 'projects'}, auth=False),
  22 + url(display=_('Repositories'), viewname='mezuro',
  23 + kwargs={'path': 'repositories'}, auth=False),
  24 + url(display=_('Configurations'), viewname='mezuro',
  25 + kwargs={'path': 'kalibro_configurations'}, auth=False),
  26 + url(display=_('Reading Groups'), viewname='mezuro',
  27 + kwargs={'path': 'reading_groups'}, auth=False),
  28 +)
... ...
cookbooks/mezuro/recipes/prezento.rb
... ... @@ -34,3 +34,18 @@ execute &#39;prezento:migrate&#39; do
34 34 notifies :restart, 'service[prezento.target]'
35 35 end
36 36  
  37 +#############################################################################
  38 +# The next lines install the mezuro plugin for colab intergration #
  39 +# This shold be removed when the plugin were install thought pkg colab-deps #
  40 +#############################################################################
  41 +
  42 +git '/home/vagrant/colab-mezuro-plugin' do
  43 + repository 'https://github.com/colab/colab-mezuro-plugin.git'
  44 + revision 'master'
  45 +end
  46 +
  47 +execute 'pip:install:plugin' do
  48 + command '/usr/lib/colab/bin/pip install .'
  49 + cwd '/home/vagrant/colab-mezuro-plugin'
  50 + user 'root'
  51 +end
... ...