Class: SimpleDeploy::Config
- Inherits:
-
Object
- Object
- SimpleDeploy::Config
- Defined in:
- lib/simple_deploy/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #artifact_repository ⇒ Object
- #artifacts ⇒ Object
- #deploy_script ⇒ Object
- #environment(name) ⇒ Object
- #environments ⇒ Object
- #gateway ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #keys ⇒ Object
- #load_config_file ⇒ Object
- #region(name) ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/simple_deploy/config.rb', line 6 def initialize load_config_file end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/simple_deploy/config.rb', line 4 def config @config end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/simple_deploy/config.rb', line 4 def logger @logger end |
Instance Method Details
#artifact_repository ⇒ Object
47 48 49 |
# File 'lib/simple_deploy/config.rb', line 47 def artifact_repository config['artifact_repository'] end |
#artifacts ⇒ Object
15 16 17 |
# File 'lib/simple_deploy/config.rb', line 15 def artifacts config['deploy']['artifacts'] end |
#deploy_script ⇒ Object
31 32 33 |
# File 'lib/simple_deploy/config.rb', line 31 def deploy_script config['deploy']['script'] end |
#environment(name) ⇒ Object
39 40 41 |
# File 'lib/simple_deploy/config.rb', line 39 def environment(name) environments[name] end |
#environments ⇒ Object
35 36 37 |
# File 'lib/simple_deploy/config.rb', line 35 def environments config['environments'] end |
#gateway ⇒ Object
23 24 25 |
# File 'lib/simple_deploy/config.rb', line 23 def gateway config['deploy']['gateway'] end |
#keys ⇒ Object
19 20 21 |
# File 'lib/simple_deploy/config.rb', line 19 def keys config['deploy']['keys'] ||= "#{env_home}/.ssh/id_rsa" end |
#load_config_file ⇒ Object
10 11 12 13 |
# File 'lib/simple_deploy/config.rb', line 10 def load_config_file config_file = "#{ENV['HOME']}/.simple_deploy.yml" self.config = YAML::load( File.open( config_file ) ) end |
#region(name) ⇒ Object
43 44 45 |
# File 'lib/simple_deploy/config.rb', line 43 def region(name) environment(name)['region'] end |
#user ⇒ Object
27 28 29 |
# File 'lib/simple_deploy/config.rb', line 27 def user config['deploy']['user'] ||= "#{env_user}" end |