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)


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

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.



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

def environment
  @environment
end

#notificationsObject (readonly)

Returns the value of attribute notifications.



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

def notifications
  @notifications
end

Instance Method Details

#access_keyObject



105
106
107
# File 'lib/simple_deploy/configuration.rb', line 105

def access_key
  @environment['access_key']
end

#artifact_cloud_formation_url(artifact) ⇒ Object



94
95
96
97
98
99
# File 'lib/simple_deploy/configuration.rb', line 94

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



87
88
89
90
91
92
# File 'lib/simple_deploy/configuration.rb', line 87

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



83
84
85
# File 'lib/simple_deploy/configuration.rb', line 83

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

#deploy_scriptObject



101
102
103
# File 'lib/simple_deploy/configuration.rb', line 101

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

#regionObject



117
118
119
# File 'lib/simple_deploy/configuration.rb', line 117

def region
  @environment['region']
end

#secret_keyObject



109
110
111
# File 'lib/simple_deploy/configuration.rb', line 109

def secret_key
  @environment['secret_key']
end

#security_tokenObject



113
114
115
# File 'lib/simple_deploy/configuration.rb', line 113

def security_token
  @environment['security_token']
end

#temporary_credentials?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/simple_deploy/configuration.rb', line 121

def temporary_credentials?
  !!security_token
end