meow-deploy 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ == 0.2.0 / 2012-12-14
2
+ * Minor Enhancements
3
+ * Use restart.txt touch to restart god app
data/examples/god.conf CHANGED
@@ -33,19 +33,70 @@ end script
33
33
 
34
34
 
35
35
  # /etc/god.conf
36
- # Basic god.conf to load currently configured sites on reboot
36
+ # Basic god.conf to load currently configured sites on reboot and the custom condition
37
37
 
38
+ God.load "/etc/god.d/*.rb"
38
39
  God.load "/home/deploy/sites/god/*.conf"
39
40
 
41
+ # /etc/god.d/file_touched.rb
42
+ # Custom condition necessary until God > 0.13.1 is released
43
+ module God
44
+ module Conditions
45
+
46
+ # Condition Symbol :file_touched
47
+ # Type: Poll
48
+ #
49
+ # Trigger when a specified file is touched.
50
+ #
51
+ # Paramaters
52
+ # Required
53
+ # +path+ is the path to the file to watch.
54
+ #
55
+ # Examples
56
+ #
57
+ # Trigger if 'tmp/restart.txt' file is touched (from a Watch):
58
+ #
59
+ # on.condition(:file_touched) do |c|
60
+ # c.path = 'tmp/restart.txt'
61
+ # end
62
+ #
63
+ class FileTouched < PollCondition
64
+ attr_accessor :path
65
+
66
+ def initialize
67
+ super
68
+ self.path = nil
69
+ end
70
+
71
+ def valid?
72
+ valid = true
73
+ valid &= complain("Attribute 'path' must be specified", self) if self.path.nil?
74
+ valid
75
+ end
76
+
77
+ def test
78
+ if File.exists?(self.path)
79
+ (Time.now - File.mtime(self.path)) <= self.interval
80
+ else
81
+ false
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+
88
+
40
89
  # app/config/god.conf
41
90
  # App specific file for god, goes under your app root.
42
91
  # Gets symlinked to god_conf_path
43
92
 
93
+ site_root = '/home/deploy/sites/app'
94
+
44
95
  God.watch do |w|
45
96
  w.name = "app"
46
- w.dir = "/home/deploy/sites/app/current"
97
+ w.dir = "#{site_root}/current"
47
98
  w.interval = 30.seconds
48
- w.log = '/home/deploy/sites/app/shared/log/god.log'
99
+ w.log = "#{site_root}/shared/log/god.log"
49
100
  w.env =
50
101
  { 'HOME' => "/home/deploy",
51
102
  'RAILS_ENV' => 'production' }
@@ -63,6 +114,11 @@ God.watch do |w|
63
114
  c.times = 2
64
115
  c.notify = 'kris'
65
116
  end
117
+
118
+ on.condition(:file_touched) do |c|
119
+ c.interval = 5.seconds
120
+ c.path = "#{site_root}/shared/restart.txt"
121
+ end
66
122
  end
67
123
 
68
124
  w.transition(:up, :start) do |on|
@@ -54,7 +54,7 @@ module Meow
54
54
  end
55
55
 
56
56
  task :restart, :roles => :app, :except => {:no_release => true} do
57
- sudo "#{rbenv} exec god restart #{application}"
57
+ run "touch #{shared_path}/restart.txt"
58
58
  end
59
59
 
60
60
  task :start, :roles => :app do
@@ -1,5 +1,5 @@
1
1
  module Meow
2
2
  module Deploy
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,32 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meow-deploy
3
3
  version: !ruby/object:Gem::Version
4
+ version: 0.2.0
4
5
  prerelease:
5
- version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kristjan Rang
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2012-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
- none: false
21
- name: capistrano
22
22
  type: :runtime
23
23
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ! '>='
27
28
  - !ruby/object:Gem::Version
28
29
  version: '0'
29
- none: false
30
30
  description: Tasks for deploying to a stack running god, rbenv and whatever rails
31
31
  server
32
32
  email: mail@kristjanrang.eu
@@ -35,6 +35,7 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - .gitignore
38
+ - CHANGELOG
38
39
  - Gemfile
39
40
  - LICENSE.txt
40
41
  - README.md
@@ -51,17 +52,17 @@ rdoc_options: []
51
52
  require_paths:
52
53
  - lib
53
54
  required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
54
56
  requirements:
55
57
  - - ! '>='
56
58
  - !ruby/object:Gem::Version
57
59
  version: '0'
58
- none: false
59
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
60
62
  requirements:
61
63
  - - ! '>='
62
64
  - !ruby/object:Gem::Version
63
65
  version: '0'
64
- none: false
65
66
  requirements: []
66
67
  rubyforge_project:
67
68
  rubygems_version: 1.8.23