Class: BbDeploy::Deployer
- Inherits:
-
Object
- Object
- BbDeploy::Deployer
- Includes:
- Logger
- Defined in:
- lib/bb_deploy/deployer.rb
Instance Attribute Summary collapse
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
Instance Method Summary collapse
- #deploy! ⇒ Object
-
#initialize(phase:) ⇒ Deployer
constructor
A new instance of Deployer.
Methods included from Logger
#chat_broadcast, logger, #slack
Constructor Details
#initialize(phase:) ⇒ Deployer
Returns a new instance of Deployer.
13 14 15 16 17 |
# File 'lib/bb_deploy/deployer.rb', line 13 def initialize(phase:) BbDeploy::Config.configure_from_yaml('config/deploy.yml') BbDeploy::Config.set_heroku_fields!(phase: phase) @phase = phase end |
Instance Attribute Details
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
11 12 13 |
# File 'lib/bb_deploy/deployer.rb', line 11 def phase @phase end |
Instance Method Details
#deploy! ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bb_deploy/deployer.rb', line 19 def deploy! BbDeploy::Git.check_git_status! check_access! staging_checks if phase == 'staging' prompt = "Do you want to deploy #{current_branch} to #{BbDeploy::Config.application_name} #{phase}?" if phase == 'production' do_deploy if BbDeploy::Task.ask(prompt, required_response: 'production', important: true) else do_deploy if BbDeploy::Task.ask(prompt) end end |