Module: Hatchet
- Defined in:
- lib/hatchet.rb,
lib/hatchet/app.rb,
lib/hatchet/config.rb,
lib/hatchet/git_app.rb,
lib/hatchet/version.rb,
lib/hatchet/anvil_app.rb
Defined Under Namespace
Classes: AnvilApp, App, BadRepoName, Config, GitApp, MissingConfig, ParserError
Constant Summary
collapse
- RETRIES =
Integer(ENV['HATCHET_RETRIES'] || 1)
- VERSION =
"1.3.1"
Class Method Summary
collapse
Class Method Details
.git_branch ⇒ Object
19
20
21
22
23
24
|
# File 'lib/hatchet.rb', line 19
def self.git_branch
return ENV['TRAVIS_BRANCH'] if ENV['TRAVIS_BRANCH']
out = `git describe --contains --all HEAD`.strip
raise "Attempting to find current branch name. Error: Cannot describe git: #{out}" unless $?.success?
out
end
|
.set_deploy_strategy! ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/hatchet.rb', line 26
def self.set_deploy_strategy!
deploy_strat = (ENV['HATCHET_DEPLOY_STRATEGY'] || :anvil).to_sym
case Hatchet::const_set("DEPLOY_STRATEGY", deploy_strat)
when :anvil
Hatchet.const_set("Runner", Hatchet::AnvilApp)
when :git
Hatchet.const_set("Runner", Hatchet::GitApp)
else
raise "unknown deploy strategy #{Hatchet::DEPLOY_STRATEGY}, expected 'anvil', 'git'"
end
end
|