Skip to content

Commit a5bfedb

Browse files
committed
Adds the option to pass in STACK_VERSION to download artifacts
This way we don't need to have a running cluster to check the version and we can request a specific version.
1 parent 79ca5c2 commit a5bfedb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

rake_tasks/elasticsearch_tasks.rake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ namespace :elasticsearch do
5050
end
5151
end
5252

53-
5453
def package_url(filename, build_hash)
5554
begin
5655
artifacts = JSON.parse(File.read(filename))
@@ -93,11 +92,13 @@ namespace :elasticsearch do
9392
task :download_artifacts do
9493
json_filename = CURRENT_PATH.join('tmp/artifacts.json')
9594

96-
# Get version number and build hash of running cluster:
97-
version_number = cluster_info['number']
98-
build_hash = cluster_info['build_hash']
95+
unless (version_number = ENV['STACK_VERSION'])
96+
# Get version number and build hash of running cluster:
97+
version_number = cluster_info['number']
98+
build_hash = cluster_info['build_hash']
99+
puts "Build hash: #{build_hash}"
100+
end
99101

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

0 commit comments

Comments
 (0)