aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-22 12:23:20 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-23 09:15:49 +0100
commit0e7afc75608cd190908e92c1fb31e288dfb718f9 (patch)
tree212d10a2833a5b658d42f50d3c00497424e6d88d
parentffbb807c5383a2e40b9e82a3c6f0adfce6417cba (diff)
Show Alaveteli version number on debug page (using last git tag in history)
-rw-r--r--app/controllers/admin_general_controller.rb1
-rw-r--r--app/views/admin_general/debug.rhtml2
2 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index e192d097c..43ca4f093 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -80,6 +80,7 @@ class AdminGeneralController < AdminController
def debug
@current_commit = `git log -1 --format="%H"`
@current_branch = `git branch | grep "\*" | awk '{print $2}'`
+ @current_version = `git describe --always --tags`
repo = `git remote show origin -n | grep Fetch | awk '{print $3}' | sed -re 's/.*:(.*).git/\\1/'`
@github_origin = "https://github.com/#{repo.strip}/tree/"
@request_env = request.env
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.rhtml
index 40fe33616..d7bf1c6da 100644
--- a/app/views/admin_general/debug.rhtml
+++ b/app/views/admin_general/debug.rhtml
@@ -7,6 +7,8 @@
<h2>Version numbers</h2>
<p>
+Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %>
+<br>
Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
<br>
Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %>