capistrano-hivequeen 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  ## If your rubyforge_project name is different, then edit it and comment out
7
7
  ## the sub! line in the Rakefile
8
8
  s.name = 'capistrano-hivequeen'
9
- s.version = '0.4.4'
9
+ s.version = '0.4.5'
10
10
  s.date = '2011-10-07'
11
11
 
12
12
  ## Make sure your summary is short. The description may be as long
@@ -5,7 +5,7 @@ Capistrano::Configuration.instance(:must_exist).load do
5
5
  HiveQueen.endpoint = hivequeen_endpoint
6
6
  HiveQueen.project = application
7
7
  HiveQueen.logger = logger
8
- HiveQueen.set_credentials!
8
+ HiveQueen.get_credentials!
9
9
 
10
10
  # Redefine stage tasks from multistage extension
11
11
  # Set the list of available stages
@@ -32,4 +32,34 @@ Capistrano::Configuration.instance.load do
32
32
  logger.debug servers.join("\n") if servers.any?
33
33
  end
34
34
  end
35
+
36
+ before "deploy:restart", "app:upgrade"
37
+ namespace :app do
38
+ # NB: if preload_app is true, reload will not pick up application changes.
39
+ # Use upgrade instead.
40
+ # See http://unicorn.bogomips.org/SIGNALS.html
41
+ %w(start stop restart upgrade).each do |action|
42
+ desc "#{action} the unicorn processes"
43
+ task action, :roles => fetch(:app_roles, [:app]) do
44
+ run "/etc/init.d/unicorn_#{application} #{action}"
45
+ end
46
+ end
47
+ end
48
+
49
+ # Ensure background jobs are stopped before running a migrations
50
+ before "deploy:migrate", "bg:stop"
51
+ # Ensure background jobs are stopped before symlinking (as part of a normal deploy)
52
+ before "deploy:symlink", "bg:stop"
53
+ # Restart background jobs after the app is restarted
54
+ after "deploy:restart", "bg:restart"
55
+
56
+ namespace :bg do
57
+ %w(start stop restart).each do |action|
58
+ desc "#{action} the delayed_job processes"
59
+ task action, :roles => fetch(:bg_roles, [:bg]) do
60
+ run "sv #{action} `cd /etc/service; ls -d dj_*`"
61
+ end
62
+ end
63
+ end
64
+
35
65
  end
@@ -33,8 +33,8 @@ class HiveQueen
33
33
  @roles[env_id] ||= fetch("/environments/#{env_id}.json")
34
34
  end
35
35
 
36
- # Try to load credentials, or read them from ~/.hivequeen
37
- def set_credentials!
36
+ # Load credentials from ~/.hivequeen
37
+ def get_credentials!
38
38
  @username, @password = File.read(credential_path).chomp.split(':')
39
39
  raise unless username && password
40
40
  rescue Errno::ENOENT, RuntimeError
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-hivequeen
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 4
10
- version: 0.4.4
9
+ - 5
10
+ version: 0.4.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Suggs