Class: SimpleDeploy::Configuration::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, notifications) ⇒ Config

Returns a new instance of Config.

Raises:

  • (ArgumentError)


48
49
50
51
52
53
# File 'lib/simple_deploy/configuration.rb', line 48

def initialize(environment, notifications)
  raise ArgumentError.new("environment must be defined") unless environment

  @environment = environment
  @notifications = notifications
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



46
47
48
# File 'lib/simple_deploy/configuration.rb', line 46

def environment
  @environment
end

#notificationsObject (readonly)

Returns the value of attribute notifications.



46
47
48
# File 'lib/simple_deploy/configuration.rb', line 46

def notifications
  @notifications
end

Instance Method Details

#access_keyObject



77
78
79
# File 'lib/simple_deploy/configuration.rb', line 77

def access_key
  @environment['access_key']
end

#artifact_cloud_formation_url(artifact) ⇒ Object



66
67
68
69
70
71
# File 'lib/simple_deploy/configuration.rb', line 66

def artifact_cloud_formation_url(artifact)
  name_to_url_map = { 'chef_repo' => 'ChefRepoURL',
                      'app'       => 'AppArtifactURL',
                      'cookbooks' => 'CookbooksURL' }
  name_to_url_map[artifact]
end

#artifact_deploy_variable(artifact) ⇒ Object



59
60
61
62
63
64
# File 'lib/simple_deploy/configuration.rb', line 59

def artifact_deploy_variable(artifact)
  name_to_variable_map = { 'chef_repo' => 'CHEF_REPO_URL',
                           'app'       => 'APP_URL',
                           'cookbooks' => 'COOKBOOKS_URL' }
  name_to_variable_map[artifact]
end

#artifactsObject



55
56
57
# File 'lib/simple_deploy/configuration.rb', line 55

def artifacts
  ['chef_repo', 'cookbooks', 'app']
end

#deploy_scriptObject



73
74
75
# File 'lib/simple_deploy/configuration.rb', line 73

def deploy_script
  '/opt/intu/admin/bin/configure.sh'
end

#regionObject



85
86
87
# File 'lib/simple_deploy/configuration.rb', line 85

def region
  @environment['region']
end

#secret_keyObject



81
82
83
# File 'lib/simple_deploy/configuration.rb', line 81

def secret_key
  @environment['secret_key']
end