crossroads_capistrano 1.4.9 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "crossroads_capistrano"
|
6
|
-
s.version = "1.4.
|
6
|
+
s.version = "1.4.10"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
|
9
9
|
s.email = ["it_dept@crossroads.org.hk"]
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Crossroads shared capistrano recipes
|
2
2
|
|
3
3
|
if defined?(Capistrano::Configuration) && Capistrano::Configuration.instance
|
4
|
-
require 'capistrano/ext/multistage'
|
5
|
-
require 'bundler/capistrano' unless $no_bundler rescue LoadError
|
6
4
|
require 'capistrano_colors' rescue LoadError puts "Capistrano Colors is not installed."
|
7
|
-
|
8
5
|
Capistrano::Configuration.instance(:must_exist).load do
|
6
|
+
# Require multistage & bundler unless disabled.
|
7
|
+
require 'capistrano/ext/multistage' if fetch(:multistage, true)
|
8
|
+
require 'bundler/capistrano' if fetch(:bundler, true) rescue LoadError
|
9
|
+
|
9
10
|
set :rails_root, Dir.pwd # For tasks that need the root directory
|
10
11
|
|
11
|
-
# Load base defaults unless
|
12
|
-
|
12
|
+
# Load base defaults unless disabled.
|
13
|
+
if fetch(:base_defaults, true)
|
13
14
|
load File.join(File.dirname(__FILE__), "crossroads_capistrano/recipes/base.rb")
|
14
15
|
end
|
15
16
|
|
@@ -5,7 +5,7 @@ namespace :deploy do
|
|
5
5
|
# Following line 'right-aligns' the branch string.
|
6
6
|
branch_indent = " "*(i=10-branch.size;i<0 ? 0 : i) << branch.capitalize
|
7
7
|
current_is_deployed = current == latest
|
8
|
-
puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application}
|
8
|
+
puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application}#{exists?(:stage) ? ' ' << stage : ''}\033[0;32m]\033[0m\n\n"
|
9
9
|
puts " \033[1;33m#{branch_indent} Branch: \033[1;37m#{latest}\033[0m"
|
10
10
|
puts " \033[#{current == latest ? 1 : 0};33mDeployed Revision: \033[#{current == latest ? 1 : 0};37m#{current}\033[0m"
|
11
11
|
puts " \033[#{previous == latest ? 1 : 0};33mPrevious Revision: \033[#{previous == latest ? 1 : 0};37m#{previous}\033[0m\n\n"
|
@@ -2,12 +2,16 @@
|
|
2
2
|
# Updates the crontab using wheneverize
|
3
3
|
#
|
4
4
|
|
5
|
-
namespace :
|
5
|
+
namespace :whenever do
|
6
6
|
desc "Update the crontab file"
|
7
|
-
task :
|
7
|
+
task :update, :roles => :db do
|
8
8
|
run "cd #{current_path} && bundle exec whenever --update-crontab #{application}"
|
9
9
|
end
|
10
|
+
desc "Clear the crontab file"
|
11
|
+
task :clear, :roles => :db do
|
12
|
+
run "cd #{current_path} && bundle exec whenever --clear-crontab #{application}"
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
|
-
after "deploy:symlink", "
|
16
|
+
after "deploy:symlink", "whenever:update"
|
13
17
|
|