Module: Commands::Checks
- Included in:
- Heroploy::CheckTaskLib, Heroploy::EnvTaskLib
- Defined in:
- lib/heroploy/commands/checks.rb
Instance Method Summary collapse
- #check_branch(branch_name, valid_branch, env_name) ⇒ Object
- #check_pushed(branch_name) ⇒ Object
- #check_remote(remote) ⇒ Object
- #check_staged(remote, branch_name, env_name) ⇒ Object
Instance Method Details
#check_branch(branch_name, valid_branch, env_name) ⇒ Object
19 20 21 22 23 |
# File 'lib/heroploy/commands/checks.rb', line 19 def check_branch(branch_name, valid_branch, env_name) unless branch_name == valid_branch raise "Cannot deploy branch #{branch_name} to #{env_name}" end end |
#check_pushed(branch_name) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/heroploy/commands/checks.rb', line 9 def check_pushed(branch_name) unless git_remote_has_branch?('origin', branch_name) raise "Branch #{branch_name} doesn't exist in origin" end if git_remote_behind?('origin', branch_name) then raise "Branch #{branch_name} is behind origin/#{branch_name}" end end |
#check_remote(remote) ⇒ Object
3 4 5 6 7 |
# File 'lib/heroploy/commands/checks.rb', line 3 def check_remote(remote) unless git_remote_exists?(remote) raise "Could not find remote '#{remote}'" end end |
#check_staged(remote, branch_name, env_name) ⇒ Object
25 26 27 28 29 |
# File 'lib/heroploy/commands/checks.rb', line 25 def check_staged(remote, branch_name, env_name) unless git_staged?(remote, branch_name) raise "Changes not yet staged on #{env_name}" end end |