-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add epi_deploy:set_branch task for manually set the Capistrano :branc…
…h variable on deployment
- Loading branch information
1 parent
f9baca3
commit c174c8c
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
load File.join(File.dirname(__FILE__), 'tasks', 'multi_customers.rb') | ||
Dir.glob(File.join(File.dirname(__FILE__), 'tasks', '*.rb')).each { |f| require f } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if File.exist?('config/initializers/version.rb') | ||
require_relative 'config/initializers/version' | ||
end | ||
|
||
namespace :epi_deploy do | ||
task :set_branch do | ||
branch = if ENV['BRANCH'] | ||
ENV['BRANCH'] | ||
elsif Object.const_defined?('LATEST_RELEASE_TAG') | ||
LATEST_RELEASE_TAG | ||
end | ||
|
||
if branch.nil? | ||
raise 'Cannot determine commit to deploy as BRANCH environment variable is not set and LATEST_RELEASE_TAG constant in version.rb could not be found' | ||
end | ||
|
||
set :branch, branch | ||
end | ||
end | ||
|
||
before 'deploy:starting', 'epi_deploy:set_branch' |