Skip to content

Instantly share code, notes, and snippets.

@ironcladlou
Last active October 29, 2019 21:01
Show Gist options
  • Save ironcladlou/25f2b43a38fcc0e28725aa65cf1de7ab to your computer and use it in GitHub Desktop.
Save ironcladlou/25f2b43a38fcc0e28725aa65cf1de7ab to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Takes a URL like: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/logs/release-openshift-origin-installer-e2e-aws-serial-4.3/1331
require 'uri'
in_url = ARGV[0]
path = in_url.split("/")[5..-1].join("/")
dir = [ENV['HOME'], 'ci-runs', path.split("/")[-2..-1].join("_")].join("/")
url = URI.join("https://gcsweb-ci.svc.ci.openshift.org/gcs/", path)
puts "Browseable URL: #{url}"
puts "Downloading to #{dir}"
puts `mkdir #{dir}`
puts `gsutil -m cp -r gs://#{path} #{dir}`
puts "Downloaded to #{dir}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment