Class: GitRunner::Instruction::Deploy
- Defined in:
- lib/git-runner-deploy.rb
Overview
Performs deployments using capistrano (cap deploy)
Constant Summary collapse
- VERSION =
'0.2.0'
Instance Attribute Summary collapse
-
#clone_directory ⇒ Object
Returns the value of attribute clone_directory.
Instance Method Summary collapse
Instance Attribute Details
#clone_directory ⇒ Object
Returns the value of attribute clone_directory.
12 13 14 |
# File 'lib/git-runner-deploy.rb', line 12 def clone_directory @clone_directory end |
Instance Method Details
#perform ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/git-runner-deploy.rb', line 19 def perform GitRunner::Hooks.fire(:deploy_begin, self) start_time = Time.now Text.out(Text.green("Performing Deploy (#{environment_from_branch(branch)})"), :heading) checkout_branch prepare_deploy_environment perform_deploy end_time = Time.now Text.out(Text.green("\u2714 Deploy successful, completed in #{(end_time - start_time).ceil} seconds")) rescue Exception => ex GitRunner::Hooks.fire(:deploy_failure, self) raise ex end |
#should_run? ⇒ Boolean
15 16 17 |
# File 'lib/git-runner-deploy.rb', line 15 def should_run? branches.empty? || branches.include?(branch.name) end |