class Forger::Script

Class for forger compile command

Class for forger upload command

Public Class Methods

new(options={}) click to toggle source
# File lib/forger/script.rb, line 3
def initialize(options={})
  @options = options
end

Public Instance Methods

add_to_user_data!(user_data) click to toggle source
# File lib/forger/script.rb, line 7
def add_to_user_data!(user_data)
  user_data
end
auto_terminate() click to toggle source
# File lib/forger/script.rb, line 15
def auto_terminate
  # set variables for the template
  @ami_name = @options[:ami_name]
  load_template("auto_terminate.sh")
end
auto_terminate_after_timeout() click to toggle source
# File lib/forger/script.rb, line 11
def auto_terminate_after_timeout
  load_template("auto_terminate_after_timeout.sh")
end
cloudwatch() click to toggle source
# File lib/forger/script.rb, line 21
def cloudwatch
  load_template("cloudwatch.sh")
end
create_ami() click to toggle source
# File lib/forger/script.rb, line 25
def create_ami
  # set variables for the template
  @ami_name = @options[:ami_name]
  @region = 'us-east-1' if ENV['TEST']
  @region ||= `aws configure get region`.strip rescue 'us-east-1'
  load_template("ami_creation.sh")
end
extract_forger_scripts() click to toggle source
# File lib/forger/script.rb, line 33
def extract_forger_scripts
  load_template("extract_forger_scripts.sh")
end

Private Instance Methods

load_template(name) click to toggle source
# File lib/forger/script.rb, line 38
def load_template(name)
  template = IO.read(File.expand_path("script/templates/#{name}", File.dirname(__FILE__)))
  ERB.new(template, nil, "-").result(binding) # text
end