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

[CI] Updates artifact task for when there's no match in build hashes #2240

Merged
merged 1 commit into from
Nov 9, 2023
Merged
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: 4 additions & 4 deletions rake_tasks/elasticsearch_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ namespace :elasticsearch do
exit 1
end

# Get the build hash if it hasn't been set from a running cluster
@build_hash ||= artifacts['version']['builds'].first.dig('projects', 'elasticsearch', 'commit_hash')

# Either find the artifacts for the exact same build hash from the current running cluster or
# use the first one from the list of builds:
build_hash_artifact = artifacts['version']['builds'].find do |build|
build.dig('projects', 'elasticsearch', 'commit_hash') == @build_hash
end
end || artifacts['version']['builds'].first if build_hash_artifact.nil?

zip_url = build_hash_artifact.dig('projects', 'elasticsearch', 'packages').select { |k, _| k =~ /rest-resources-zip/ }.map { |_, v| v['url'] }.first

# Dig into the elasticsearch packages, search for the rest-resources-zip package and return the URL:
Expand Down
Loading