rigger 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.10
1
+ 0.2.11
@@ -1,8 +1,8 @@
1
1
  require "stringio"
2
2
 
3
- set :current_path, "/var/www/fetlife"
4
- server :app, "james@jamesgolick.com"
5
- server :db, "fetlife@app1.dal.fetlife"
3
+ set :current_path, "/var/www/yr_app_home"
4
+ server :app, "app@server"
5
+ server :db, "db@server"
6
6
 
7
7
  namespace :fuck do
8
8
  task :test, :depends => [] do
@@ -45,14 +45,14 @@ module Rigger
45
45
  execute(command, @current_servers) do |ch|
46
46
  ch.on_data do |c, data|
47
47
  data.split("\n").each do |line|
48
- puts " ** [#{ch[:host]} :: stdout] #{line}"
48
+ $stdout.puts" ** [#{ch[:host]} :: stdout] #{line}"
49
49
  $stdout.flush
50
50
  end
51
51
  end
52
52
 
53
53
  ch.on_extended_data do |c, type, data|
54
54
  data.split("\n").each do |line|
55
- puts " ** [#{ch[:host]} :: stderr] #{line}"
55
+ $stderr.puts" ** [#{ch[:host]} :: stderr] #{line}"
56
56
  $stderr.flush
57
57
  end
58
58
  end
@@ -68,7 +68,7 @@ module Rigger
68
68
 
69
69
  ch.on_extended_data do |c, type, data|
70
70
  data.split("\n").each do |line|
71
- puts " ** [#{server.connection_string} :: stderr] #{line}"
71
+ $stderr.puts " ** [#{server.connection_string} :: stderr] #{line}"
72
72
  $stderr.flush
73
73
  end
74
74
  end
@@ -76,6 +76,32 @@ module Rigger
76
76
  end
77
77
  end
78
78
 
79
+ def capture_all(command)
80
+ {:stdout => "", :stderr => ""}.tap do |captured|
81
+ execute(command, [@current_servers.first]) do |ch|
82
+ ch.on_data do |c, data|
83
+ captured[:stdout] << data
84
+ end
85
+
86
+ ch.on_extended_data do |c, type, data|
87
+ captured[:stderr] << data
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ def erl_call(cookie, node, code)
94
+ streams = capture_all("echo '#{code}' | erl_call -e -c #{cookie} -n #{node}")
95
+
96
+ if !streams[:stderr].empty?
97
+ raise CommandError, "erl_call #{code} failed on #{@current_servers.first.connection_string}: #{streams[:stderr]}"
98
+ end
99
+
100
+ if !streams[:stdout].include?('{ok,')
101
+ raise CommandError, "erl_call #{code} failed on #{@current_servers.first.connection_string}: #{streams[:stdout]}"
102
+ end
103
+ end
104
+
79
105
  def run_task(task_name)
80
106
  @execution_service.call(task_name)
81
107
  end
@@ -84,11 +110,13 @@ module Rigger
84
110
  puts " * executing `#{command}` locally"
85
111
  status = POpen4.popen4(command) do |stdout, stderr, stdin, pid|
86
112
  stdout.each_line do |line|
87
- puts " ** [locally :: stdout] #{line}"
113
+ $stdout.puts " ** [locally :: stdout] #{line}"
114
+ $stdout.flush
88
115
  end
89
116
 
90
117
  stderr.each_line do |line|
91
- puts " ** [locally :: stderr] #{line}"
118
+ $stderr.puts " ** [locally :: stderr] #{line}"
119
+ $stderr.flush
92
120
  end
93
121
  end
94
122
 
@@ -0,0 +1,48 @@
1
+ rigger
2
+ ======
3
+
4
+ Deployments with a DSL that resembles capistrano/vlad's, but way simpler, and things like rolling restarts are possible. For about 6 months, we've been using rigger to deploy fetlife.com and related services dozens of times per day.
5
+
6
+ gem install rigger
7
+
8
+ config
9
+ ------
10
+
11
+ Edit `config/rig.rb`
12
+
13
+ set :current_path, "/var/www/yr_app_home"
14
+ server :app, "app@server"
15
+ server :db, "db@server"
16
+
17
+ dsl
18
+ ---
19
+
20
+ see `rigger/recipes` for examples
21
+
22
+ role = @current_servers.first.role
23
+ conf = get(:chef_config).merge(:role => role,
24
+ :run_list => "role[#{role}]").to_json
25
+ run "mkdir -p #{get(:release_path)}/config"
26
+ chef_config =<<-_END_
27
+ cookbook_path ["/var/chef/cookbooks",
28
+ "#{get(:release_path)}/cookbooks"]
29
+ log_level :info
30
+ file_cache_path "/var/chef"
31
+ role_path "#{get(:release_path)}/roles"
32
+ Chef::Log::Formatter.show_time = false
33
+ _END_
34
+ put chef_config, get(:release_path) + "/config/chef-solo.rb"
35
+ put conf, get(:release_path) + "/config/chef.json"
36
+
37
+ wanted
38
+ ------
39
+
40
+ * specs
41
+ * docs
42
+
43
+ Copyright
44
+ =========
45
+
46
+ Copyright (c) 2011 James Golick. See LICENSE.txt for
47
+ further details.
48
+
@@ -0,0 +1,102 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "rigger"
8
+ s.version = "0.2.11"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["James Golick"]
12
+ s.date = "2012-01-17"
13
+ s.description = ""
14
+ s.email = "jamesgolick@gmail.com"
15
+ s.executables = ["rig"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "TODO"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".rspec",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "Rakefile",
27
+ "TODO",
28
+ "VERSION",
29
+ "bin/rig",
30
+ "config/rig.rb",
31
+ "lib/rigger.rb",
32
+ "lib/rigger/cli.rb",
33
+ "lib/rigger/connection_set.rb",
34
+ "lib/rigger/dsl.rb",
35
+ "lib/rigger/execution_strategy.rb",
36
+ "lib/rigger/recipes/chef.rb",
37
+ "lib/rigger/recipes/deploy.rb",
38
+ "lib/rigger/recipes/sbt.rb",
39
+ "lib/rigger/recipes/service.rb",
40
+ "lib/rigger/server.rb",
41
+ "lib/rigger/server_resolver.rb",
42
+ "lib/rigger/task.rb",
43
+ "lib/rigger/task_execution_service.rb",
44
+ "lib/rigger/task_executor.rb",
45
+ "readme.md",
46
+ "rigger.gemspec",
47
+ "spec/server_resolver_spec.rb",
48
+ "spec/spec_helper.rb"
49
+ ]
50
+ s.homepage = "http://github.com/jamesgolick/rigger"
51
+ s.licenses = ["MIT"]
52
+ s.require_paths = ["lib"]
53
+ s.rubygems_version = "1.8.10"
54
+ s.summary = ""
55
+ s.test_files = [
56
+ "spec/server_resolver_spec.rb",
57
+ "spec/spec_helper.rb"
58
+ ]
59
+
60
+ if s.respond_to? :specification_version then
61
+ s.specification_version = 3
62
+
63
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
64
+ s.add_runtime_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
65
+ s.add_runtime_dependency(%q<net-sftp>, ["= 2.0.5"])
66
+ s.add_runtime_dependency(%q<popen4>, ["= 0.1.2"])
67
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
68
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
69
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
70
+ s.add_development_dependency(%q<rcov>, [">= 0"])
71
+ s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
72
+ s.add_development_dependency(%q<bourne>, [">= 1.0"])
73
+ s.add_runtime_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
74
+ s.add_runtime_dependency(%q<popen4>, ["= 0.1.2"])
75
+ else
76
+ s.add_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
77
+ s.add_dependency(%q<net-sftp>, ["= 2.0.5"])
78
+ s.add_dependency(%q<popen4>, ["= 0.1.2"])
79
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
80
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
81
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
82
+ s.add_dependency(%q<rcov>, [">= 0"])
83
+ s.add_dependency(%q<mocha>, [">= 0.9.8"])
84
+ s.add_dependency(%q<bourne>, [">= 1.0"])
85
+ s.add_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
86
+ s.add_dependency(%q<popen4>, ["= 0.1.2"])
87
+ end
88
+ else
89
+ s.add_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
90
+ s.add_dependency(%q<net-sftp>, ["= 2.0.5"])
91
+ s.add_dependency(%q<popen4>, ["= 0.1.2"])
92
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
93
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
94
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
95
+ s.add_dependency(%q<rcov>, [">= 0"])
96
+ s.add_dependency(%q<mocha>, [">= 0.9.8"])
97
+ s.add_dependency(%q<bourne>, [">= 1.0"])
98
+ s.add_dependency(%q<net-ssh-multi>, ["= 1.0.1"])
99
+ s.add_dependency(%q<popen4>, ["= 0.1.2"])
100
+ end
101
+ end
102
+
metadata CHANGED
@@ -1,213 +1,151 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rigger
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.11
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 10
10
- version: 0.2.10
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - James Golick
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-21 00:00:00 -07:00
19
- default_executable: rig
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-01-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: net-ssh-multi
16
+ requirement: &70106964233800 !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
25
- - - "="
26
- - !ruby/object:Gem::Version
27
- hash: 21
28
- segments:
29
- - 1
30
- - 0
31
- - 1
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
32
21
  version: 1.0.1
33
- prerelease: false
34
22
  type: :runtime
35
- requirement: *id001
36
- name: net-ssh-multi
37
- - !ruby/object:Gem::Dependency
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ version_requirements: *70106964233800
25
+ - !ruby/object:Gem::Dependency
26
+ name: net-sftp
27
+ requirement: &70106964250060 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - "="
42
- - !ruby/object:Gem::Version
43
- hash: 5
44
- segments:
45
- - 2
46
- - 0
47
- - 5
29
+ requirements:
30
+ - - =
31
+ - !ruby/object:Gem::Version
48
32
  version: 2.0.5
49
- prerelease: false
50
33
  type: :runtime
51
- requirement: *id002
52
- name: net-sftp
53
- - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ version_requirements: *70106964250060
36
+ - !ruby/object:Gem::Dependency
37
+ name: popen4
38
+ requirement: &70106964249180 !ruby/object:Gem::Requirement
55
39
  none: false
56
- requirements:
57
- - - "="
58
- - !ruby/object:Gem::Version
59
- hash: 31
60
- segments:
61
- - 0
62
- - 1
63
- - 2
40
+ requirements:
41
+ - - =
42
+ - !ruby/object:Gem::Version
64
43
  version: 0.1.2
65
- prerelease: false
66
44
  type: :runtime
67
- requirement: *id003
68
- name: popen4
69
- - !ruby/object:Gem::Dependency
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
45
+ prerelease: false
46
+ version_requirements: *70106964249180
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &70106964246880 !ruby/object:Gem::Requirement
71
50
  none: false
72
- requirements:
51
+ requirements:
73
52
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 3
76
- segments:
77
- - 2
78
- - 3
79
- - 0
53
+ - !ruby/object:Gem::Version
80
54
  version: 2.3.0
81
- prerelease: false
82
55
  type: :development
83
- requirement: *id004
84
- name: rspec
85
- - !ruby/object:Gem::Dependency
86
- version_requirements: &id005 !ruby/object:Gem::Requirement
56
+ prerelease: false
57
+ version_requirements: *70106964246880
58
+ - !ruby/object:Gem::Dependency
59
+ name: bundler
60
+ requirement: &70106964245260 !ruby/object:Gem::Requirement
87
61
  none: false
88
- requirements:
62
+ requirements:
89
63
  - - ~>
90
- - !ruby/object:Gem::Version
91
- hash: 23
92
- segments:
93
- - 1
94
- - 0
95
- - 0
64
+ - !ruby/object:Gem::Version
96
65
  version: 1.0.0
97
- prerelease: false
98
66
  type: :development
99
- requirement: *id005
100
- name: bundler
101
- - !ruby/object:Gem::Dependency
102
- version_requirements: &id006 !ruby/object:Gem::Requirement
67
+ prerelease: false
68
+ version_requirements: *70106964245260
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: &70106964244580 !ruby/object:Gem::Requirement
103
72
  none: false
104
- requirements:
73
+ requirements:
105
74
  - - ~>
106
- - !ruby/object:Gem::Version
107
- hash: 7
108
- segments:
109
- - 1
110
- - 5
111
- - 2
75
+ - !ruby/object:Gem::Version
112
76
  version: 1.5.2
113
- prerelease: false
114
77
  type: :development
115
- requirement: *id006
116
- name: jeweler
117
- - !ruby/object:Gem::Dependency
118
- version_requirements: &id007 !ruby/object:Gem::Requirement
119
- none: false
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- hash: 3
124
- segments:
125
- - 0
126
- version: "0"
127
78
  prerelease: false
128
- type: :development
129
- requirement: *id007
79
+ version_requirements: *70106964244580
80
+ - !ruby/object:Gem::Dependency
130
81
  name: rcov
131
- - !ruby/object:Gem::Dependency
132
- version_requirements: &id008 !ruby/object:Gem::Requirement
82
+ requirement: &70106964258660 !ruby/object:Gem::Requirement
133
83
  none: false
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- hash: 43
138
- segments:
139
- - 0
140
- - 9
141
- - 8
142
- version: 0.9.8
143
- prerelease: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
144
88
  type: :development
145
- requirement: *id008
89
+ prerelease: false
90
+ version_requirements: *70106964258660
91
+ - !ruby/object:Gem::Dependency
146
92
  name: mocha
147
- - !ruby/object:Gem::Dependency
148
- version_requirements: &id009 !ruby/object:Gem::Requirement
93
+ requirement: &70106964257400 !ruby/object:Gem::Requirement
149
94
  none: false
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- hash: 15
154
- segments:
155
- - 1
156
- - 0
157
- version: "1.0"
158
- prerelease: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: 0.9.8
159
99
  type: :development
160
- requirement: *id009
100
+ prerelease: false
101
+ version_requirements: *70106964257400
102
+ - !ruby/object:Gem::Dependency
161
103
  name: bourne
162
- - !ruby/object:Gem::Dependency
163
- version_requirements: &id010 !ruby/object:Gem::Requirement
104
+ requirement: &70106964255800 !ruby/object:Gem::Requirement
164
105
  none: false
165
- requirements:
166
- - - "="
167
- - !ruby/object:Gem::Version
168
- hash: 21
169
- segments:
170
- - 1
171
- - 0
172
- - 1
173
- version: 1.0.1
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '1.0'
110
+ type: :development
174
111
  prerelease: false
175
- type: :runtime
176
- requirement: *id010
112
+ version_requirements: *70106964255800
113
+ - !ruby/object:Gem::Dependency
177
114
  name: net-ssh-multi
178
- - !ruby/object:Gem::Dependency
179
- version_requirements: &id011 !ruby/object:Gem::Requirement
115
+ requirement: &70106964254820 !ruby/object:Gem::Requirement
180
116
  none: false
181
- requirements:
182
- - - "="
183
- - !ruby/object:Gem::Version
184
- hash: 31
185
- segments:
186
- - 0
187
- - 1
188
- - 2
189
- version: 0.1.2
190
- prerelease: false
117
+ requirements:
118
+ - - =
119
+ - !ruby/object:Gem::Version
120
+ version: 1.0.1
191
121
  type: :runtime
192
- requirement: *id011
122
+ prerelease: false
123
+ version_requirements: *70106964254820
124
+ - !ruby/object:Gem::Dependency
193
125
  name: popen4
194
- description: ""
126
+ requirement: &70106964253820 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - =
130
+ - !ruby/object:Gem::Version
131
+ version: 0.1.2
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: *70106964253820
135
+ description: ''
195
136
  email: jamesgolick@gmail.com
196
- executables:
137
+ executables:
197
138
  - rig
198
139
  extensions: []
199
-
200
- extra_rdoc_files:
140
+ extra_rdoc_files:
201
141
  - LICENSE.txt
202
- - README.rdoc
203
142
  - TODO
204
- files:
143
+ files:
205
144
  - .document
206
145
  - .rspec
207
146
  - Gemfile
208
147
  - Gemfile.lock
209
148
  - LICENSE.txt
210
- - README.rdoc
211
149
  - Rakefile
212
150
  - TODO
213
151
  - VERSION
@@ -227,42 +165,38 @@ files:
227
165
  - lib/rigger/task.rb
228
166
  - lib/rigger/task_execution_service.rb
229
167
  - lib/rigger/task_executor.rb
168
+ - readme.md
169
+ - rigger.gemspec
230
170
  - spec/server_resolver_spec.rb
231
171
  - spec/spec_helper.rb
232
- has_rdoc: true
233
172
  homepage: http://github.com/jamesgolick/rigger
234
- licenses:
173
+ licenses:
235
174
  - MIT
236
175
  post_install_message:
237
176
  rdoc_options: []
238
-
239
- require_paths:
177
+ require_paths:
240
178
  - lib
241
- required_ruby_version: !ruby/object:Gem::Requirement
179
+ required_ruby_version: !ruby/object:Gem::Requirement
242
180
  none: false
243
- requirements:
244
- - - ">="
245
- - !ruby/object:Gem::Version
246
- hash: 3
247
- segments:
181
+ requirements:
182
+ - - ! '>='
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ segments:
248
186
  - 0
249
- version: "0"
250
- required_rubygems_version: !ruby/object:Gem::Requirement
187
+ hash: 1501622079518446762
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
251
189
  none: false
252
- requirements:
253
- - - ">="
254
- - !ruby/object:Gem::Version
255
- hash: 3
256
- segments:
257
- - 0
258
- version: "0"
190
+ requirements:
191
+ - - ! '>='
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
259
194
  requirements: []
260
-
261
195
  rubyforge_project:
262
- rubygems_version: 1.3.9.2
196
+ rubygems_version: 1.8.10
263
197
  signing_key:
264
198
  specification_version: 3
265
- summary: ""
266
- test_files:
199
+ summary: ''
200
+ test_files:
267
201
  - spec/server_resolver_spec.rb
268
202
  - spec/spec_helper.rb
@@ -1,19 +0,0 @@
1
- = rigger
2
-
3
- Description goes here.
4
-
5
- == Contributing to rigger
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2011 James Golick. See LICENSE.txt for
18
- further details.
19
-