capistrano_evrone_recipes 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fbb96a70ae38e23e257589d0fce134ffd413ce4
4
- data.tar.gz: d5f78a522c1653edba10c3208bc53eb4b84d674b
3
+ metadata.gz: 96ff19ed8c4f61b21d72c6e175830d981bb89759
4
+ data.tar.gz: 2db18e7a99d6a4d82b7cf0ad1a19ad30f5069695
5
5
  SHA512:
6
- metadata.gz: 37d8af7ecad59d88b9b2f306479ea9b1d362afcb36b6fcd0719bb7b9b8a7eb798782c5177532d29f4c9a8fbbd07798c03a951f73a9a51a5027abcc455cd3e208
7
- data.tar.gz: 15c783746c83a02282bd45898c427347c447e66c335ff7bceb8686e1674f9bc8ff829b1e65186c3f5ecbb340c3783215efd2efb40af4705380ec0a4ac0d2f93a
6
+ metadata.gz: 6f795161581dc3c16bf3a33fe883fcf87d5131e947edf72baf604a3b6c4a53981e65b0b7e82803b1565bad893b7cbaf2ebe45f3fb279d81dec7cf45eaae838d2
7
+ data.tar.gz: a61d1381d2f2a5ed6a1ebaf63736d88be192aef331f96026abc7b03657f4c7ce405eaf6e61d98f51f29f8ea7807df632d0482009901db0e1ccaaf7fbe9b1e33d
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
 
20
20
  s.add_runtime_dependency("capistrano", ["= 2.15.5"])
21
- s.add_runtime_dependency("colored", [">= 0"])
22
21
  s.add_runtime_dependency("foreman", [">= 0"])
23
22
  s.add_runtime_dependency("foreman_export_runitu", [">= 0"])
24
23
  s.add_runtime_dependency("whenever", ["~> 0.8.4"])
@@ -1,4 +1,3 @@
1
- require 'logger'
2
1
  require File.dirname(__FILE__) + "/util"
3
2
 
4
3
  Capistrano::Configuration.instance(:must_exist).load do
@@ -3,6 +3,7 @@ _cset(:runit_services_path) { "#{deploy_to}/services" }
3
3
  _cset(:runit_export_cmd) { "#{fetch :bundle_cmd} exec foreman export runitu" }
4
4
  _cset(:runit_procfile) { "Procfile" }
5
5
  _cset(:foreman_concurency) { nil }
6
+ _cset(:runit_restart_cmd) { "sv -v t $(pwd)/*" }
6
7
 
7
8
  namespace :runit do
8
9
 
@@ -11,15 +12,16 @@ namespace :runit do
11
12
  if find_servers_for_task(current_task).any?
12
13
  cmd = %Q{
13
14
  if [ -d #{runit_export_path} ] ; then
14
- echo "----> Updating services" ;
15
+ echo -n "----> Update services" ;
15
16
  rm -rf #{runit_services_path}/* ;
16
17
  sync ;
17
18
  cp -r #{runit_export_path}/* #{runit_services_path}/ ;
18
19
  sync ;
19
20
  rm -rf #{runit_export_path} ;
20
21
  else
21
- echo "----> Restart services" ;
22
- test $(ls -1 #{runit_services_path} | wc -l) -eq 0 || sv t #{runit_services_path}/* ;
22
+ echo -n "----> Restart services" ;
23
+ test $(ls -1 #{runit_services_path} | wc -l) -eq 0 ||
24
+ (cd #{fetch :runit_services_path} && #{fetch :runit_restart_cmd, "/bin/true"}) ;
23
25
  fi
24
26
  }.compact
25
27
  run cmd
@@ -43,12 +45,16 @@ namespace :runit do
43
45
  desc "Export Procfile"
44
46
  task :export, :roles => :worker, :on_no_matching_servers => :continue, :except => { :no_release => true } do
45
47
  if find_servers_for_task(current_task).any?
46
- CapistranoEvroneRecipes::Util.ensure_changed_remote_files(self, fetch(:runit_procfile)) do
47
- env = %{ RAILS_ENV=#{rails_env} }.strip + "\n"
48
- put(env, "#{latest_release}/.env")
48
+ env = %{ RAILS_ENV=#{rails_env} }.strip + "\n"
49
+ put(env, "#{latest_release}/.env")
49
50
 
50
- c = fetch(:foreman_concurency) ? "-c #{fetch :foreman_concurency}" : ""
51
- cmd = %{
51
+ c = fetch(:foreman_concurency) ? "-c #{fetch :foreman_concurency}" : ""
52
+ diff = ENV['FORCE'] ?
53
+ %{ /bin/false } :
54
+ %{ diff -q #{previous_release}/#{runit_procfile} #{latest_release}/#{runit_procfile} > /dev/null }
55
+ cmd = %{
56
+ #{diff} || (
57
+ echo -n "----> Export #{runit_procfile}" ;
52
58
  cd #{latest_release} &&
53
59
  #{runit_export_cmd} #{runit_export_path}
54
60
  -e #{latest_release}/.env
@@ -56,17 +62,13 @@ namespace :runit do
56
62
  -f #{latest_release}/#{runit_procfile}
57
63
  --root=#{current_path}
58
64
  -a #{application} #{c} > /dev/null &&
59
- echo -n "----> Export #{runit_procfile}"
60
- }.compact
61
- run cmd
62
65
 
63
- cmd = %{
64
- for i in $(ls #{runit_export_path}/); do
65
- sed -i 's|#{runit_export_path}|#{runit_services_path}|g' #{runit_export_path}/${i}/run ;
66
- done
67
- }.compact
68
- run cmd
69
- end
66
+ for i in $(ls #{runit_export_path}/); do
67
+ sed -i 's|#{runit_export_path}|#{runit_services_path}|g' #{runit_export_path}/${i}/run ;
68
+ done
69
+ )
70
+ }.compact
71
+ run cmd
70
72
  end
71
73
  end
72
74
  end
@@ -3,7 +3,7 @@ module CapistranoEvroneRecipes
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 17
6
+ PATCH = 18
7
7
 
8
8
  def self.to_s
9
9
  "#{MAJOR}.#{MINOR}.#{PATCH}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_evrone_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-19 00:00:00.000000000 Z
11
+ date: 2013-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.15.5
27
- - !ruby/object:Gem::Dependency
28
- name: colored
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: foreman
43
29
  requirement: !ruby/object:Gem::Requirement