Merge branch 'storing_templates_in_s3' into features
This commit is contained in:
commit
cb520d0128
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user