Extend config/version.rb with more informations (#5061)

This gives installations not using git checkouts
to provide all the informations needed for the
internal version checks and version display in
the dashboard.

The build:stamp rake task was extended to also
add the new informations.
This commit is contained in:
darix
2017-08-28 18:24:56 +02:00
committed by Sam
parent d70ecf1c53
commit 4b5724ec02
3 changed files with 42 additions and 18 deletions

View File

@ -1,8 +1,13 @@
desc "stamp the current build with the git hash placed in version.rb"
task "build:stamp" => :environment do
git_version = `git rev-parse HEAD`.strip
git_version = `git rev-parse HEAD`.strip
git_branch = `git rev-parse --abbrev-ref HEAD`
full_version = `git describe --dirty --match "v[0-9]*"`
File.open(Rails.root.to_s + '/config/version.rb', 'w') do |f|
f.write("$git_version = #{git_version.inspect}\n")
f.write("$git_version = #{git_version.inspect}\n")
f.write("$git_branch = #{git_branch.inspect}\n")
f.write("$full_version = #{full_version.inspect}\n")
end
puts "Stamped current build with #{git_version}"
puts "Stamped current build with #{git_version} #{git_branch} #{full_version}"
end