Skip to content

Commit

Permalink
Adds the option to pass in STACK_VERSION to download artifacts
Browse files Browse the repository at this point in the history
This way we don't need to have a running cluster to check the version and we can request a specific version.
  • Loading branch information
picandocodigo committed Nov 24, 2021
1 parent 79ca5c2 commit a5bfedb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rake_tasks/elasticsearch_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ namespace :elasticsearch do
end
end


def package_url(filename, build_hash)
begin
artifacts = JSON.parse(File.read(filename))
Expand Down Expand Up @@ -93,11 +92,13 @@ namespace :elasticsearch do
task :download_artifacts do
json_filename = CURRENT_PATH.join('tmp/artifacts.json')

# Get version number and build hash of running cluster:
version_number = cluster_info['number']
build_hash = cluster_info['build_hash']
unless (version_number = ENV['STACK_VERSION'])
# Get version number and build hash of running cluster:
version_number = cluster_info['number']
build_hash = cluster_info['build_hash']
puts "Build hash: #{build_hash}"
end

puts "Build hash: #{build_hash}"
# Create ./tmp if it doesn't exist
Dir.mkdir(CURRENT_PATH.join('tmp'), 0700) unless File.directory?(CURRENT_PATH.join('tmp'))

Expand Down

0 comments on commit a5bfedb

Please sign in to comment.