Last active
October 29, 2019 21:01
-
-
Save ironcladlou/25f2b43a38fcc0e28725aa65cf1de7ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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