Class: Forger::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/forger/script/upload.rb,
lib/forger/script.rb,
lib/forger/script/compile.rb,
lib/forger/script/compress.rb

Overview

Class for forger compile command

Defined Under Namespace

Classes: Compile, Compress, Upload

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Script

Returns a new instance of Script.



3
4
5
# File 'lib/forger/script.rb', line 3

def initialize(options={})
  @options = options
end

Instance Method Details

#add_to_user_data!(user_data) ⇒ Object



7
8
9
# File 'lib/forger/script.rb', line 7

def add_to_user_data!(user_data)
  user_data
end

#auto_terminateObject



15
16
17
18
19
# 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_timeoutObject



11
12
13
# File 'lib/forger/script.rb', line 11

def auto_terminate_after_timeout
  load_template("auto_terminate_after_timeout.sh")
end

#cloudwatchObject



21
22
23
# File 'lib/forger/script.rb', line 21

def cloudwatch
  load_template("cloudwatch.sh")
end

#create_amiObject



25
26
27
28
29
30
31
# 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_scriptsObject



33
34
35
# File 'lib/forger/script.rb', line 33

def extract_forger_scripts
  load_template("extract_forger_scripts.sh")
end