Class: Conan::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/conan/deploy.rb

Class Method Summary collapse

Class Method Details

.run(options) ⇒ Object



6
7
8
9
10
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
37
38
39
# File 'lib/conan/deploy.rb', line 6

def self.run(options)
  puts "> Pipeline: #{options[:pipeline]}"
  puts "> Environment: #{options[:environment]}"

  manifest = ManifestBuilder.build(options) {
    m = File.join(options[:directory], 'environments.rb')
    puts "> Manifest: #{m}"
    instance_eval(File.read(m), m)
  }

  case options[:action]
  when :provision
    manifest.provision
  when :configure
    manifest.configure
  when :deploy
    manifest.deploy
  when :bg_configure
    manifest.bg_configure
  when :bg_deploy
    manifest.bg_deploy
  when :all
    manifest.provision
    manifest.configure
    manifest.deploy
  when :bg_all
    manifest.provision
    manifest.bg_configure
    manifest.bg_deploy

  else
    raise ArgumentError.new "Invalid action: #{options[:action]}"
  end
end