Merge branch 'storing_templates_in_s3' into features

This commit is contained in:
Anton Chuchkalov 2016-01-13 14:57:29 +03:00
commit cb520d0128
2 changed files with 7 additions and 5 deletions

View File

@ -36,7 +36,7 @@ module Devops
def generate_template_file_and_upload_to_storage(id, json)
uniq_filename = "#{id}-#{SecureRandom.hex}.template"
provider_instance.store_file(uniq_filename, json)['url']
provider_instance.store_stack_template(uniq_filename, json)['url']
end
end

View File

@ -322,11 +322,13 @@ module Provider
self.compute.describe_vpcs.body["vpcSet"].select{|v| v["state"] == "available"}.map{|v| {"vpc_id" => v["vpcId"], "cidr" => v["cidrBlock"] } }
end
# use public_url for a while because there is no possibility to create
# non expiring private links via fog
def store_file(filename, json)
def store_stack_template(filename, json)
store_file(stack_templates_bucket, filename, json)
end
def store_file(bucket, filename, body)
{
'url' => stack_templates_bucket.files.create(key: filename, body: json, public: true).public_url
'url' => bucket.files.create(key: filename, body: body, public: true).public_url
}
end