You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
516 B
Ruby

release_data = \
if (tomo_json = Rails.root.join(".tomo_release.json")).file?
JSON.parse(File.read(tomo_json))
elsif (heroku_commit = ENV.fetch("HEROKU_SLUG_COMMIT", nil)).present?
{ "revision" => heroku_commit, "revision_date" => ENV.fetch("HEROKU_RELEASE_CREATED_AT", nil) }
else
{ "revision" => "N/A", "revision_date" => Time.current.to_s }
end
Rails.application.config.version = release_data["revision"]
Rails.application.config.version_time = Time.zone.parse(release_data["revision_date"])