mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 06:08:19 -04:00
Backport PR #12728 to 7.x branch Prior to this release a VERSION_QUALIFER env set to an empty string would create versions looking like `8.0.0--SNAPSHOT` instead of `8.0.0-SNAPSHOT`, causing the release manager builds to fail.
24 lines
576 B
Ruby
Executable file
24 lines
576 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
#
|
|
# Print the Elastic Stack version for the current branch, as defined in
|
|
# the 'version.json' file.
|
|
#
|
|
require 'yaml'
|
|
|
|
def get_hard_coded_version
|
|
version_info = YAML::safe_load(IO.read('../versions.yml'))
|
|
version_info['logstash']
|
|
end
|
|
|
|
def qualify(version)
|
|
qualifier = ENV['VERSION_QUALIFIER']
|
|
qualifier.nil? || qualifier.empty? ? version : [version, qualifier].join("-")
|
|
end
|
|
|
|
def get_version
|
|
version = get_hard_coded_version()
|
|
version = qualify(version)
|
|
ENV["RELEASE"] == "1" ? version : [version, "SNAPSHOT"].join("-")
|
|
end
|
|
|
|
puts get_version
|