Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inject VERSION_QUALIFIER into artifacts #16904

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion logstash-core-plugin-api/logstash-core-plugin-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def host
end

def version
LOGSTASH_CORE_VERSION
LOGSTASH_VERSION
jsvd marked this conversation as resolved.
Show resolved Hide resolved
end

def http_address
Expand Down
8 changes: 7 additions & 1 deletion logstash-core/logstash-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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|
Expand Down
6 changes: 1 addition & 5 deletions rakelib/artifacts.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ namespace "artifact" do
SNAPSHOT_BUILD = ENV["RELEASE"] != "1"
VERSION_QUALIFIER = ENV["VERSION_QUALIFIER"]
LOCAL_ARTIFACTS = ENV["LOCAL_ARTIFACTS"] || "true"
if VERSION_QUALIFIER
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-#{VERSION_QUALIFIER}-SNAPSHOT" : "-#{VERSION_QUALIFIER}"
else
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-SNAPSHOT" : ""
end
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-SNAPSHOT" : ""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer need to add the qualifier to the artifact's name explictly here, since it will be added already through the version yml.


## TODO: Install new service files
def package_files
Expand Down
Loading