Class: Rudy::Routines::Release

Inherits:
Base
  • Object
show all
Defined in:
lib/rudy/routines/release.rb

Instance Method Summary collapse

Methods inherited from Base

#enjoy_every_sandwich, #execute_dependency, #generic_machine_runner, #has_remote_task?, #initialize, #keep_going?, #machine_separator, #preliminary_separator, #routine_separator, #task_separator

Methods included from Huxtable

change_environment, change_position, change_region, change_role, change_zone, #check_keys, #config_dirname, create_domain, #current_group_name, #current_machine_address, #current_machine_count, #current_machine_group, #current_machine_hostname, #current_machine_image, #current_machine_name, #current_machine_size, #current_user, #current_user_keypairpath, debug?, #debug?, domain, domain_exists?, #group_metadata, #has_keypair?, #has_keys?, #has_pem_keys?, #has_root_keypair?, keypair_path_to_name, #known_machine_group?, #root_keypairname, #root_keypairpath, #switch_user, update_config, update_global, update_logger, #user_keypairname, #user_keypairpath

Constructor Details

This class inherits a constructor from Rudy::Routines::Base

Instance Method Details

#executeObject



11
12
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/rudy/routines/release.rb', line 11

def execute()
  routine_separator(@routine_name)

  vlist = []
  
  # Some early version control system failing
  if Rudy::Routines::SCMHelper.scm?(@routine)
    vlist = Rudy::Routines::SCMHelper.create_scm_objects(@routine)
    puts task_separator("CREATING RELEASE TAG#{'S' if vlist.size > 1}")
    vlist.each do |scm|
      scm.create_release(Rudy.sysinfo.user)
      puts scm.liner_note
    end
  end
  
  machines = []
  generic_machine_runner(:list) do |machine,rbox|
    vlist.each do |scm|
      puts task_separator("CREATING REMOTE #{scm.engine.to_s.upcase} CHECKOUT")
      scm.create_remote_checkout(rbox)
    end
    machines << machine
  end
  
  machines
end

#init(*args) ⇒ Object



6
7
8
9
# File 'lib/rudy/routines/release.rb', line 6

def init(*args)
  @routine_name = args.first || :release # :release or :rerelease
  @routine = fetch_routine_config(@routine_name)
end

#raise_early_exceptionsObject

Called by generic_machine_runner

Raises:



39
40
41
42
43
44
45
# File 'lib/rudy/routines/release.rb', line 39

def raise_early_exceptions
  raise NoRoutine, :release unless @routine
  rmach = Rudy::Machines.new
  raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
  raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
  raise MachineGroupNotRunning, current_machine_group unless rmach.running?
end