From 767d6106f5f72ab4b7ec576bb9338aebd06a27dd Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Wed, 15 Oct 2014 17:34:19 +1100 Subject: [PATCH 1/2] update deployment process settings modal takes the current git version, OR the .gvb_version file. BUT if neither exist, it doesn't show anything. The deployment process creates the .gvb_version file as a cat of `git version-bump show` and commits it to the temporary branch (which is only used by giddyup, and never goes to github) This should match with the commentary from mpalmer/git-version-bump:issue#2 --- .gvb_version | 1 - app/helpers/layouts/application_layout_helper.rb | 6 +++++- app/views/partial/navbar/_settings_modal.html.erb | 6 +++--- deploy | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 .gvb_version diff --git a/.gvb_version b/.gvb_version deleted file mode 100644 index 3a3cd8c..0000000 --- a/.gvb_version +++ /dev/null @@ -1 +0,0 @@ -1.3.1 diff --git a/app/helpers/layouts/application_layout_helper.rb b/app/helpers/layouts/application_layout_helper.rb index 8e6ff6c..8c854f3 100644 --- a/app/helpers/layouts/application_layout_helper.rb +++ b/app/helpers/layouts/application_layout_helper.rb @@ -49,7 +49,11 @@ def version rescue v = File.read(".gvb_version") if File.exists?(".gvb_version") end - link_to v, "https://github.com/anchor/machiavelli/releases/tag/v#{v}", target: "blank" if v + # If we got a version then use it to construct a link to the github tag of the same + if v + l = link_to v, "https://github.com/anchor/machiavelli/releases/tag/v#{v}", target: "blank" if v + return "version #{l} ".html_safe + end end # Flash message styling based on the error level diff --git a/app/views/partial/navbar/_settings_modal.html.erb b/app/views/partial/navbar/_settings_modal.html.erb index 42cc6da..dd940ba 100644 --- a/app/views/partial/navbar/_settings_modal.html.erb +++ b/app/views/partial/navbar/_settings_modal.html.erb @@ -54,9 +54,9 @@
 
diff --git a/deploy b/deploy index c75dc1c..ec59bba 100755 --- a/deploy +++ b/deploy @@ -21,6 +21,8 @@ end def deploy env branch = git_branch run "git checkout -b deploy_temp" + run "git version-bump show > .gvb_version" + run "git commit .gvb_version -m 'update .gvb_version'" run "bundle exec rake assets:precompile", { "RAILS_ENV" => env } run "git add public/assets" run "git commit public/assets -m'compile assets'" From dbe0a8e56b3f507e9ce6842b6d8f24b166e7e574 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Thu, 16 Oct 2014 13:36:26 +1100 Subject: [PATCH 2/2] add and commit file --- deploy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy b/deploy index ec59bba..d7b3665 100755 --- a/deploy +++ b/deploy @@ -22,7 +22,8 @@ def deploy env branch = git_branch run "git checkout -b deploy_temp" run "git version-bump show > .gvb_version" - run "git commit .gvb_version -m 'update .gvb_version'" + run "git add #{@version_file}" + run "git commit #{@version_file} -m 'update #{@version_file}'" run "bundle exec rake assets:precompile", { "RAILS_ENV" => env } run "git add public/assets" run "git commit public/assets -m'compile assets'"