Class: Lono::Template::Upload

Inherits:
AbstractBase show all
Defined in:
lib/lono/template/upload.rb

Instance Method Summary collapse

Methods inherited from AbstractBase

#reinitialize, #template_path

Methods included from Blueprint::Root

#find_blueprint_root, #set_blueprint_root

Constructor Details

#initialize(options = {}) ⇒ Upload

Returns a new instance of Upload.



8
9
10
11
12
# File 'lib/lono/template/upload.rb', line 8

def initialize(options={})
  super
  @checksums = {}
  @prefix = Lono.env # s3://s3-bucket/development
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
# File 'lib/lono/template/upload.rb', line 14

def run
  puts "Uploading CloudFormation templates..."
  paths = Dir.glob("#{Lono.config.output_path}/#{@blueprint}/templates/**/*")
  paths.select { |p| File.file?(p) }.each do |path|
    Lono::S3::Uploader.new(path).upload
  end
  puts "Templates uploaded to s3."
end