mirror of
https://github.com/elastic/logstash.git
synced 2025-04-17 19:35:03 -04:00
Don't honor VERSION_QUALIFIER if set but empty (#17032)
PR #17006 revealed that the `VERSION_QUALIFIER` env var gets honored in various scripts when present but empty. This shouldn't be the case as the DRA process is designed to gracefully ignore empty values for this variable. This commit changes various ruby scripts to not treat "" as truthy. Bash scripts (used by CI etc.) are already ok with this as part of refactorings done in #16907. --------- Co-authored-by: Andrea Selva <selva.andre@gmail.com>
This commit is contained in:
parent
e23da7985c
commit
c7204fd7d6
4 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@ if File.exist?(project_versions_yaml_path)
|
|||
# each time we build the logstash-core gem
|
||||
original_lines = IO.readlines(project_versions_yaml_path)
|
||||
# introduce the version qualifier (e.g. beta1, rc1) into the copied yml so it's displayed by Logstash
|
||||
if ENV['VERSION_QUALIFIER']
|
||||
unless ENV['VERSION_QUALIFIER'].to_s.strip.empty?
|
||||
logstash_version_line = original_lines.find {|line| line.match(/^logstash:/) }
|
||||
logstash_version_line.chomp!
|
||||
logstash_version_line << "-#{ENV['VERSION_QUALIFIER']}\n"
|
||||
|
|
|
@ -18,7 +18,7 @@ if File.exist?(project_versions_yaml_path)
|
|||
# each time we build the logstash-core gem
|
||||
original_lines = IO.readlines(project_versions_yaml_path)
|
||||
# introduce the version qualifier (e.g. beta1, rc1) into the copied yml so it's displayed by Logstash
|
||||
if ENV['VERSION_QUALIFIER']
|
||||
unless ENV['VERSION_QUALIFIER'].to_s.strip.empty?
|
||||
logstash_version_line = original_lines.find {|line| line.match(/^logstash:/) }
|
||||
logstash_version_line.chomp!
|
||||
logstash_version_line << "-#{ENV['VERSION_QUALIFIER']}\n"
|
||||
|
|
|
@ -13,7 +13,7 @@ def version
|
|||
end
|
||||
|
||||
def qualified_version
|
||||
qualifier = ENV['VERSION_QUALIFIER']
|
||||
qualifier = ENV['VERSION_QUALIFIER'].to_s.strip.empty? ? nil : ENV['VERSION_QUALIFIER']
|
||||
qualified_version = qualifier ? [version, qualifier].join("-") : version
|
||||
ENV["RELEASE"] == "1" ? qualified_version : [qualified_version, "SNAPSHOT"].join("-")
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace "artifact" do
|
||||
SNAPSHOT_BUILD = ENV["RELEASE"] != "1"
|
||||
VERSION_QUALIFIER = ENV["VERSION_QUALIFIER"]
|
||||
VERSION_QUALIFIER = ENV["VERSION_QUALIFIER"].to_s.strip.empty? ? nil : ENV["VERSION_QUALIFIER"]
|
||||
LOCAL_ARTIFACTS = ENV["LOCAL_ARTIFACTS"] || "true"
|
||||
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-SNAPSHOT" : ""
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue