inject VERSION_QUALIFIER into artifacts (#16904)

VERSION_QUALIFIER was already observed in rake artifacts task but only to influence the name of the artifact.

This commit ensure that the qualifier is also displayed in the cli and in the http api.
This commit is contained in:
João Duarte 2025-01-17 10:18:35 +00:00 committed by GitHub
parent ff44b7cc20
commit 9a2cd015d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 8 deletions

View file

@ -12,7 +12,13 @@ if File.exist?(project_versions_yaml_path)
# we ignore the copy in git and we overwrite an existing file
# each time we build the logstash-core gem
original_lines = IO.readlines(project_versions_yaml_path)
original_lines << ""
# introduce the version qualifier (e.g. beta1, rc1) into the copied yml so it's displayed by Logstash
if ENV['VERSION_QUALIFIER']
logstash_version_line = original_lines.find {|line| line.match(/^logstash:/) }
logstash_version_line.chomp!
logstash_version_line << "-#{ENV['VERSION_QUALIFIER']}\n"
end
original_lines << "\n"
original_lines << "# This is a copy the project level versions.yml into this gem's root and it is created when the gemspec is evaluated."
gem_versions_yaml_path = File.expand_path("./versions-gem-copy.yml", File.dirname(__FILE__))
File.open(gem_versions_yaml_path, 'w') do |new_file|