Class: SimpleDeploy::Configuration::Config
- Inherits:
-
Object
- Object
- SimpleDeploy::Configuration::Config
- Defined in:
- lib/simple_deploy/configuration.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#notifications ⇒ Object
readonly
Returns the value of attribute notifications.
Instance Method Summary collapse
- #access_key ⇒ Object
- #artifact_cloud_formation_url(artifact) ⇒ Object
- #artifact_deploy_variable(artifact) ⇒ Object
- #artifacts ⇒ Object
- #deploy_script ⇒ Object
-
#initialize(environment, notifications) ⇒ Config
constructor
A new instance of Config.
- #region ⇒ Object
- #secret_key ⇒ Object
- #security_token ⇒ Object
- #temporary_credentials? ⇒ Boolean
Constructor Details
#initialize(environment, notifications) ⇒ Config
Returns a new instance of Config.
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
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
74 75 76 |
# File 'lib/simple_deploy/configuration.rb', line 74 def environment @environment end |
#notifications ⇒ Object (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_key ⇒ Object
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 |
#artifacts ⇒ Object
83 84 85 |
# File 'lib/simple_deploy/configuration.rb', line 83 def artifacts ['chef_repo', 'cookbooks', 'app'] end |
#deploy_script ⇒ Object
101 102 103 |
# File 'lib/simple_deploy/configuration.rb', line 101 def deploy_script '/opt/intu/admin/bin/configure.sh' end |
#region ⇒ Object
117 118 119 |
# File 'lib/simple_deploy/configuration.rb', line 117 def region @environment['region'] end |
#secret_key ⇒ Object
109 110 111 |
# File 'lib/simple_deploy/configuration.rb', line 109 def secret_key @environment['secret_key'] end |
#security_token ⇒ Object
113 114 115 |
# File 'lib/simple_deploy/configuration.rb', line 113 def security_token @environment['security_token'] end |
#temporary_credentials? ⇒ Boolean
121 122 123 |
# File 'lib/simple_deploy/configuration.rb', line 121 def temporary_credentials? !!security_token end |