Better version info communication and administration

This commit is contained in:
2014-10-06 17:18:41 +02:00
parent a57e9e2341
commit eba3500311
7 changed files with 34 additions and 4 deletions
+9 -1
View File
@@ -9,6 +9,8 @@ APP_ROOT="#{HOME}/Documents/workspace/mozo"
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
app_config_path = File.join(APP_ROOT, 'config.xml')
app_config = File.read(app_config_path)
app_index_html_path = File.join(APP_ASSET_ROOT, 'index.html')
app_index_html = File.read(app_index_html_path)
current_version = app_config.match(/version="([\.\d]+)"/)[1].to_version
new_version = File.read("config/version").strip.to_version
version_increased = false
@@ -16,7 +18,10 @@ while new_version <= current_version
version_increased = true
new_version = new_version.bump(:tiny)
end
puts "Increasing version value to #{new_version}".colorize(:red) if version_increased
if version_increased
puts "Increasing version value to #{new_version}".colorize(:red)
File.open("config/version", 'w+'){|f| f.puts new_version.to_s }
end
`spring stop`
`rm -rf #{APP_ASSET_ROOT}`
@@ -53,4 +58,7 @@ puts "Increasing version value to #{new_version}".colorize(:red) if version_incr
# rm -rf public/assets/frames;
# QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb;
`rm -rf public/assets`
# Set app versions
File.open(app_config_path, 'w+'){|f| f.puts app_config.sub(%[version="#{current_version}"], %[version="#{new_version}"])}
File.open(app_index_html_path, 'w+'){ |f| f.puts app_index_html.sub('##APP_VERSION##', new_version.to_s) }