Class: CapistranoMulticonfigParallel::StandardDeploy
- Inherits:
-
Object
- Object
- CapistranoMulticonfigParallel::StandardDeploy
- Includes:
- FileUtils
- Defined in:
- lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb
Overview
class used to find application dependencies
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#app ⇒ Object
Returns the value of attribute app.
-
#env_options ⇒ Object
Returns the value of attribute env_options.
-
#stage ⇒ Object
Returns the value of attribute stage.
-
#task_arguments ⇒ Object
Returns the value of attribute task_arguments.
Instance Method Summary collapse
- #build_capistrano_task(action = @action, env = {}) ⇒ Object
- #capistrano_action(action) ⇒ Object
- #execute_standard_deploy(action = @action) ⇒ Object
-
#initialize(options) ⇒ StandardDeploy
constructor
A new instance of StandardDeploy.
- #job_stage ⇒ Object
- #setup_command_line_standard(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ StandardDeploy
Returns a new instance of StandardDeploy.
8 9 10 11 12 13 14 15 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 8 def initialize() @app = .fetch('app', '') @stage = .fetch('env', '') @action = .fetch('action', '') @task_arguments = .fetch('task_arguments:', []) @env_options = .fetch('env_options', {}) execute_standard_deploy end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
7 8 9 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 7 def action @action end |
#app ⇒ Object
Returns the value of attribute app.
7 8 9 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 7 def app @app end |
#env_options ⇒ Object
Returns the value of attribute env_options.
7 8 9 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 7 def @env_options end |
#stage ⇒ Object
Returns the value of attribute stage.
7 8 9 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 7 def stage @stage end |
#task_arguments ⇒ Object
Returns the value of attribute task_arguments.
7 8 9 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 7 def task_arguments @task_arguments end |
Instance Method Details
#build_capistrano_task(action = @action, env = {}) ⇒ Object
34 35 36 37 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 34 def build_capistrano_task(action = @action, env = {}) = setup_command_line_standard(@env_options.merge(env)) "bundle exec cap #{job_stage} #{capistrano_action(action)} #{} --trace" end |
#capistrano_action(action) ⇒ Object
21 22 23 24 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 21 def capistrano_action(action) argv = task_arguments.present? ? "[#{@task_arguments}]" : '' "#{action}#{argv}" end |
#execute_standard_deploy(action = @action) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 39 def execute_standard_deploy(action = @action) command = build_capistrano_task(action) puts("\n\n\n Executing '#{command}' \n\n\n .") sh("#{command}") # rescue => ex # CapistranoMulticonfigParallel.log_message(ex) # execute_standard_deploy('deploy:rollback') if action.blank? && @name == 'deploy' end |
#job_stage ⇒ Object
17 18 19 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 17 def job_stage @app.present? ? "#{@app}:#{@stage}" : "#{@stage}" end |
#setup_command_line_standard(options) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/capistrano_multiconfig_parallel/managers/standard_deploy.rb', line 26 def setup_command_line_standard() opts = '' .each do |key, value| opts << "#{key}=#{value} " if value.present? end opts end |