[DRE-commits] [redmine] 02/10: packaging changes to restore proper plugin support

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Jun 5 18:09:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository redmine.

commit d107601681b95002d4fb83e4ea7ab9bf2e9426a6
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Jun 5 13:58:20 2016 -0300

    packaging changes to restore proper plugin support
---
 debian/TODO                                      | 2 --
 debian/changelog                                 | 7 ++++++-
 debian/doc/examples/apache2-alias.conf           | 9 ++++++++-
 debian/doc/examples/apache2-host.conf            | 8 +++++++-
 debian/doc/examples/apache2-passenger-alias.conf | 5 +++++
 debian/doc/examples/apache2-passenger-host.conf  | 5 +++++
 debian/postinst                                  | 2 +-
 debian/tests/control                             | 4 ++++
 debian/tests/plugin-assets                       | 9 +++++++++
 9 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 8f3b565..f72157f 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -4,8 +4,6 @@ TODO
 * fix script/dbconsole (also a rails issue, accepted by rails maintainer, see #552615) so it can be called with :
 sudo -u www-data ./script/dbconsole -p -y "/etc/redmine/default/database.yml" production
 
-* plugin_assets should really be put in RAILS_CACHE/plugin_assets, i.e. depend on instance name.
-
 * in general, check that failures that happened with rails 2.2 don't with rails 2.3 :
 	delivery_method: :async_smtp
 	It has been reported [0] that this method does not work when used by a rake task (e.g.
diff --git a/debian/changelog b/debian/changelog
index 9003a77..9b5c440 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,12 @@
 redmine (3.2.1-3) UNRELEASED; urgency=medium
 
   * 0004-Add-multi-tenancy-support.patch: include support for plugin assets
-    and plugins migrations (Closes: #820875)
+    (Closes: #820875)
+  * debian/postinst: always run plugin migrations
+  * debian/doc/examples/apache2-*.conf: configure the plugin_assets directory
+    to be accessible to HTTP clients.
+  * debian/tests/control: add a test case for plugins, using
+    redmine-plugin-custom-css as an example.
 
  -- Antonio Terceiro <terceiro at debian.org>  Sun, 05 Jun 2016 13:54:28 -0300
 
diff --git a/debian/doc/examples/apache2-alias.conf b/debian/doc/examples/apache2-alias.conf
index 44ff386..b0b5a22 100644
--- a/debian/doc/examples/apache2-alias.conf
+++ b/debian/doc/examples/apache2-alias.conf
@@ -10,8 +10,9 @@
 	Alias "/redmine" /usr/share/redmine/public
 	<Directory "/usr/share/redmine/public">
 		Options +FollowSymLinks +ExecCGI
-		Order allow,deny
 		Allow from all
+		Options -MultiViews
+		Require all granted
 		RewriteEngine On
 		RewriteBase "/redmine"
 		RewriteRule ^$ index.html [QSA]
@@ -20,4 +21,10 @@
 		RewriteCond %{REQUEST_FILENAME} dispatch.fcgi$
 		RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
 	</Directory>
+	Alias "/redmine/plugin_assets/" /var/cache/redmine/default/plugin_assets/
+	<Directory "/var/cache/redmine/default/plugin_assets/">
+		Allow from all
+		Options -MultiViews
+		Require all granted
+	</Directory>
 </VirtualHost>
diff --git a/debian/doc/examples/apache2-host.conf b/debian/doc/examples/apache2-host.conf
index b233e5d..679fdff 100644
--- a/debian/doc/examples/apache2-host.conf
+++ b/debian/doc/examples/apache2-host.conf
@@ -9,10 +9,16 @@
     DocumentRoot /usr/share/redmine/public
     <Directory "/usr/share/redmine/public">
         Options +FollowSymLinks +ExecCGI
-        Order allow,deny
         Allow from all
+        Options -MultiViews
+        Require all granted
         RewriteEngine On
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
     </Directory>
+    <Directory "/var/cache/redmine/default/plugin_assets/">
+        Allow from all
+        Options -MultiViews
+        Require all granted
+    </Directory>
 </VirtualHost>
diff --git a/debian/doc/examples/apache2-passenger-alias.conf b/debian/doc/examples/apache2-passenger-alias.conf
index 1f93ab1..282cfb4 100644
--- a/debian/doc/examples/apache2-passenger-alias.conf
+++ b/debian/doc/examples/apache2-passenger-alias.conf
@@ -21,4 +21,9 @@
         Options -MultiViews
         Require all granted
     </Directory>
+    <Directory "/var/cache/redmine/default/plugin_assets/">
+        Allow from all
+        Options -MultiViews
+        Require all granted
+    </Directory>
 </VirtualHost>
diff --git a/debian/doc/examples/apache2-passenger-host.conf b/debian/doc/examples/apache2-passenger-host.conf
index 9d5c677..05f6657 100644
--- a/debian/doc/examples/apache2-passenger-host.conf
+++ b/debian/doc/examples/apache2-passenger-host.conf
@@ -15,4 +15,9 @@
         Options -MultiViews
         Require all granted
     </Directory>
+    <Directory "/var/cache/redmine/default/plugin_assets/">
+        Allow from all
+        Options -MultiViews
+        Require all granted
+    </Directory>
 </VirtualHost>
diff --git a/debian/postinst b/debian/postinst
index d08258c..2fbced4 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -58,7 +58,7 @@ manage_instance() {
   chmod 0640  $secret_key
 
   cd /usr/share/redmine
-  su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance SCHEMA=/dev/null bundle exec rake db:migrate"
+  su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance SCHEMA=/dev/null bundle exec rake db:migrate redmine:plugins:migrate"
 
   db_get redmine/instances/$instance/default-language || true
   REDMINE_LANG="${RET:-en}"
diff --git a/debian/tests/control b/debian/tests/control
index a0aaddf..88921d7 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -13,3 +13,7 @@ Restrictions: needs-root
 Test-Command: debian/tests/smoke-test sqlite3 apache2-passenger-alias /redmine
 Depends: redmine-sqlite, redmine, apache2, libapache2-mod-passenger, curl
 Restrictions: needs-root
+
+Test-Command: debian/tests/smoke-test sqlite3 apache2-passenger-host / && debian/tests/plugin-assets
+Depends: redmine, redmine-plugin-custom-css, apache2, libapache2-mod-passenger, curl
+Restrictions: needs-root
diff --git a/debian/tests/plugin-assets b/debian/tests/plugin-assets
new file mode 100644
index 0000000..7c802fb
--- /dev/null
+++ b/debian/tests/plugin-assets
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+for plugindir in /usr/share/redmine/plugins/*; do
+  plugin=$(basename $plugindir)
+  for f in $(find $plugindir/assets -type f); do
+    asset=${f##/usr/share/redmine/plugins/*/assets/}
+    curl -s http://localhost/plugin_assets/$plugin/$path
+  done
+done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git



More information about the Pkg-ruby-extras-commits mailing list