forked from cloudfoundry/bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cloudfoundry#1397 from ljfranklin/PR-google-heavy-…
…stemcell-127591235 Include additional Infrastructures in heavy stemcell pipeline
- Loading branch information
Showing
13 changed files
with
606 additions
and
514 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'json' | ||
require 'uri' | ||
|
||
module Bosh::Dev | ||
class StemcellDependencyFetcher | ||
def initialize(downloader, logger) | ||
@downloader = downloader | ||
@logger = logger | ||
end | ||
|
||
def download_os_image(opts) | ||
bucket_name = opts[:bucket_name] | ||
key = opts[:key] | ||
output_path = opts[:output_path] | ||
|
||
os_image_versions_file = File.expand_path('../../../../../bosh-stemcell/os_image_versions.json', __FILE__) | ||
os_image_versions = JSON.load(File.open(os_image_versions_file)) | ||
os_image_version = os_image_versions[key] | ||
if os_image_version.nil? | ||
raise "Unable to find OS image key '#{key}' in known versions: #{os_image_versions.to_json}" | ||
end | ||
|
||
os_image_uri = URI.join('https://s3.amazonaws.com/', "#{bucket_name}/", key) | ||
os_image_uri.query = URI.encode_www_form([['versionId', os_image_version]]) | ||
|
||
@downloader.download(os_image_uri, output_path) | ||
end | ||
|
||
def download_bosh_micro_release(opts) | ||
bosh_version = opts[:bosh_version] | ||
output_path = opts[:output_path] | ||
|
||
os_image_uri = URI.join('https://bosh.io/d/github.com/cloudfoundry/bosh') | ||
os_image_uri.query = URI.encode_www_form([['v', bosh_version]]) | ||
|
||
@downloader.download(os_image_uri, output_path) | ||
end | ||
end | ||
end |
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
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
Oops, something went wrong.