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(filepath) ⇒ Object
- .method_missing(method, *args) ⇒ Object
- .set_heroku_fields!(phase:) ⇒ Object
Instance Attribute Details
#application_name ⇒ Object
Returns the value of attribute application_name.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def application_name @application_name end |
#application_urls ⇒ Object
Returns the value of attribute application_urls.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def application_urls @application_urls end |
#deployment_channel ⇒ Object
Returns the value of attribute deployment_channel.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def deployment_channel @deployment_channel end |
#engineering_channel ⇒ Object
Returns the value of attribute engineering_channel.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def engineering_channel @engineering_channel end |
#logentries_token ⇒ Object
Returns the value of attribute logentries_token.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def logentries_token @logentries_token end |
#slack_webhook_key ⇒ Object
Returns the value of attribute slack_webhook_key.
5 6 7 |
# File 'lib/bb_deploy/config.rb', line 5 def slack_webhook_key @slack_webhook_key end |
Class Method Details
.configuration ⇒ Object
13 14 15 |
# File 'lib/bb_deploy/config.rb', line 13 def configuration @configuration ||= BbDeploy::Config.new end |
.configure {|configuration| ... } ⇒ Object
17 18 19 |
# File 'lib/bb_deploy/config.rb', line 17 def configure yield(configuration) end |
.configure_from_yaml(filepath) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/bb_deploy/config.rb', line 21 def configure_from_yaml(filepath) = YAML.load_file(filepath) configure do |config| %i(application_name application_urls deployment_channel engineering_channel).each do |key| config.send("#{key}=", [key]) end end end |
.method_missing(method, *args) ⇒ Object
37 38 39 |
# File 'lib/bb_deploy/config.rb', line 37 def method_missing(method, *args) configuration.send(method, *args) end |
.set_heroku_fields!(phase:) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/bb_deploy/config.rb', line 30 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 |