Adds capistrano_colors gem; deprecates custom red method
Also adjusts current_git_branch to use Capistrano's logger for printing to STDOUT
This commit is contained in:
parent
76d31f3110
commit
bbc165137f
3 changed files with 5 additions and 6 deletions
1
Gemfile
1
Gemfile
|
|
@ -138,6 +138,7 @@ end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'capistrano', '2.5.19', :require => false
|
gem 'capistrano', '2.5.19', :require => false
|
||||||
|
gem 'capistrano_colors', :require => false
|
||||||
gem 'capistrano-ext', '1.2.1', :require => false
|
gem 'capistrano-ext', '1.2.1', :require => false
|
||||||
gem 'linecache', '0.43', :platforms => :mri_18
|
gem 'linecache', '0.43', :platforms => :mri_18
|
||||||
gem 'parallel_tests'
|
gem 'parallel_tests'
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ GEM
|
||||||
net-ssh-gateway (>= 1.0.0)
|
net-ssh-gateway (>= 1.0.0)
|
||||||
capistrano-ext (1.2.1)
|
capistrano-ext (1.2.1)
|
||||||
capistrano (>= 1.0.0)
|
capistrano (>= 1.0.0)
|
||||||
|
capistrano_colors (0.5.5)
|
||||||
capybara (0.3.9)
|
capybara (0.3.9)
|
||||||
culerity (>= 0.2.4)
|
culerity (>= 0.2.4)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
|
|
@ -478,6 +479,7 @@ DEPENDENCIES
|
||||||
bundler (>= 1.0.0)
|
bundler (>= 1.0.0)
|
||||||
capistrano (= 2.5.19)
|
capistrano (= 2.5.19)
|
||||||
capistrano-ext (= 1.2.1)
|
capistrano-ext (= 1.2.1)
|
||||||
|
capistrano_colors
|
||||||
capybara (~> 0.3.9)
|
capybara (~> 0.3.9)
|
||||||
carrierwave (= 0.5.3)
|
carrierwave (= 0.5.3)
|
||||||
chef (= 0.9.12)
|
chef (= 0.9.12)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
set :config_yaml, YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml')
|
set :config_yaml, YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml')
|
||||||
|
|
||||||
|
require './config/cap_colors'
|
||||||
require 'bundler/capistrano'
|
require 'bundler/capistrano'
|
||||||
require './config/boot'
|
require './config/boot'
|
||||||
require 'hoptoad_notifier/capistrano'
|
require 'hoptoad_notifier/capistrano'
|
||||||
|
|
@ -20,15 +21,10 @@ set :scm_verbose, true
|
||||||
set :repository_cache, "remote_cache"
|
set :repository_cache, "remote_cache"
|
||||||
set :deploy_via, :checkout
|
set :deploy_via, :checkout
|
||||||
|
|
||||||
# Bonus! Colors are pretty!
|
|
||||||
def red(str)
|
|
||||||
"\e[31m#{str}\e[0m"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Figure out the name of the current local branch
|
# Figure out the name of the current local branch
|
||||||
def current_git_branch
|
def current_git_branch
|
||||||
branch = `git symbolic-ref HEAD 2> /dev/null`.strip.gsub(/^refs\/heads\//, '')
|
branch = `git symbolic-ref HEAD 2> /dev/null`.strip.gsub(/^refs\/heads\//, '')
|
||||||
puts "Deploying branch #{red branch}"
|
logger.info "Deploying branch #{branch}"
|
||||||
branch
|
branch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue