Class: BbDeploy::Config
- Inherits:
-
Object
- Object
- BbDeploy::Config
- Defined in:
- lib/bb_deploy/config.rb
Instance Attribute Summary collapse
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#application_urls ⇒ Object
Returns the value of attribute application_urls.
-
#deployment_channel ⇒ Object
Returns the value of attribute deployment_channel.
-
#engineering_channel ⇒ Object
Returns the value of attribute engineering_channel.
-
#logentries_token ⇒ Object
Returns the value of attribute logentries_token.
-
#slack_webhook_key ⇒ Object
Returns the value of attribute slack_webhook_key.
Class Method Summary collapse
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
- .configure_from_yaml(file_path) ⇒ Object
- .method_missing(method, *args) ⇒ Object
- .set_heroku_fields!(phase) ⇒ Object
Instance Attribute Details
#application_name ⇒ Object
Returns the value of attribute application_name.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def application_name @application_name end |
#application_urls ⇒ Object
Returns the value of attribute application_urls.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def application_urls @application_urls end |
#deployment_channel ⇒ Object
Returns the value of attribute deployment_channel.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def deployment_channel @deployment_channel end |
#engineering_channel ⇒ Object
Returns the value of attribute engineering_channel.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def engineering_channel @engineering_channel end |
#logentries_token ⇒ Object
Returns the value of attribute logentries_token.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def logentries_token @logentries_token end |
#slack_webhook_key ⇒ Object
Returns the value of attribute slack_webhook_key.
6 7 8 |
# File 'lib/bb_deploy/config.rb', line 6 def slack_webhook_key @slack_webhook_key end |
Class Method Details
.configuration ⇒ Object
14 15 16 |
# File 'lib/bb_deploy/config.rb', line 14 def configuration @configuration ||= BbDeploy::Config.new end |
.configure {|configuration| ... } ⇒ Object
18 19 20 21 |
# File 'lib/bb_deploy/config.rb', line 18 def configure yield(configuration) configuration end |
.configure_from_yaml(file_path) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/bb_deploy/config.rb', line 23 def configure_from_yaml(file_path) = YAML.load(ERB.new(File.read(file_path)).result) configure do |config| %w(application_name application_urls deployment_channel engineering_channel).each do |key| config.send("#{key}=", [key]) end end end |
.method_missing(method, *args) ⇒ Object
39 40 41 |
# File 'lib/bb_deploy/config.rb', line 39 def method_missing(method, *args) configuration.send(method, *args) end |
.set_heroku_fields!(phase) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/bb_deploy/config.rb', line 32 def set_heroku_fields!(phase) configure do |config| config.logentries_token = BbDeploy::Heroku.get_variable(phase, 'DEPLOY_LOG_TOKEN').freeze config.slack_webhook_key = BbDeploy::Heroku.get_variable(phase, 'SLACK_WEBHOOK').freeze end end |