diff options
Diffstat (limited to 'config/initializers/update_gs_version_number.rb')
-rw-r--r-- | config/initializers/update_gs_version_number.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb new file mode 100644 index 0000000..d9e1aae --- /dev/null +++ b/config/initializers/update_gs_version_number.rb @@ -0,0 +1,16 @@ +# The Gemeinschaft version is stored in an environment variable. +# It equals the branch in git. +# +if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] + version = GsParameter.find_or_create_by_name('GEMEINSCHAFT_VERSION') + version.section = 'Generic' + version.value = ENV['GS_VERSION'] + version.save +end + +if !ENV['GS_BUILDNAME'].nil? && GsParameter.table_exists? && GsParameter.get('GS_BUILDNAME') != ENV['GS_BUILDNAME'] + buildname = GsParameter.find_or_create_by_name('GEMEINSCHAFT_BUILDNAME') + buildname.section = 'Generic' + buildname.value = ENV['GS_BUILDNAME'] + buildname.save +end |