Class: Leeroy::Task::Fixture

Inherits:
Base
  • Object
show all
Includes:
Helpers::AWS, Helpers::Template
Defined in:
lib/leeroy/task/fixture.rb

Constant Summary

Constants included from Helpers::Logging

Helpers::Logging::TRACE_FORMAT, Helpers::Logging::TRACE_LEVELS, Helpers::Logging::TRUNCATE_THRESHOLD

Instance Attribute Summary

Attributes included from Helpers::AWS

#ec2, #rds, #s3

Attributes included from Helpers::State

#state

Attributes included from Helpers::Env

#env

Attributes included from Leeroy::Task

#args, #global_options, #options

Instance Method Summary collapse

Methods included from Helpers::Template

#renderTemplate

Methods included from Helpers::AWS

#awsRequest, #buildS3ObjectName, #checkSemaphore, #clearSemaphore, #createTags, #destroyInstance, #ec2Request, #filterImages, #genSemaphore, #getApplicationImageIndex, #getApplicationInstanceName, #getGoldMasterImageIndex, #getGoldMasterInstanceName, #getImageByName, #getMaxImageIndex, #getRDSInstanceEndpoint, #getSemaphore, #getSgId, #getSubnetId, #getVpcId, #initialize, #rdsRequest, #s3Request, #setSemaphore

Methods inherited from Base

#initialize

Methods included from Helpers::State

#dump_state, #load_state, #rotate_task_metadata, #state_from_pipe, #to_s

Methods included from Helpers::Logging

#logger

Methods included from Helpers::Env

#checkEnv

Instance Method Details

#perform(args = self.args, options = self.options, global_options = self.global_options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/leeroy/task/fixture.rb', line 13

def perform(args = self.args, options = self.options, global_options = self.global_options)
  begin
    super(args, options, global_options)

    state = self.state

    # what kind of fixture are we processing?
    fixture = Leeroy::Types::Fixture.from_s(options[:fixture])

    logger.debug "processing a '#{fixture}' fixture"

    # process it
    processed = self.send(fixture.value.to_sym, state, options)

    logger.debug "processed: #{processed.inspect}"

    dump_state

    logger.debug "done performing for #{self.class}"

  rescue StandardError => e
    raise e
  end
end