crossroads_capistrano 1.4.9 → 1.4.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.9"
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 explicitly told not to.
12
- unless $no_base
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} #{stage}\033[0;32m]\033[0m\n\n"
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 :deploy do
5
+ namespace :whenever do
6
6
  desc "Update the crontab file"
7
- task :update_crontab, :roles => :db do
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", "deploy:update_crontab"
16
+ after "deploy:symlink", "whenever:update"
13
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crossroads_capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.4.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: