Class: Copenhagen::Deploy

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

Instance Method Summary collapse

Instance Method Details

#dipObject



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
# File 'lib/copenhagen.rb', line 9

def dip
  #get our environment
  environment = ARGV[0] #currently supported: 'staging' and 'production'

  #load the config file
  yaml = YAML.load(File.open("Copenhagen.yml"))
  
  #begin the deploy
  if(yaml[environment])
    puts "Dipping to #{environment}"
    
    #get the config for this environment
    config = yaml[environment]

    #get the deployment target. Currently supported: 'heroku', 'remote-pull', 'remote-pull-with-password', 'remote-script'
    if config['target'] == 'heroku'
      heroku config
    elsif config['target'] == 'remote-pull'
      remotepull config
    elsif config['target'] == 'remote-pull-with-password'
      remotepullwithpassword config
    elsif config['target'] == 'remote-script'
      remotescript config
    end
    
  end
end