obbistrano 1.1.58 → 1.1.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -239,6 +239,42 @@ Capistrano::Configuration.instance(:must_exist).load do
239
239
  run "cd #{deploy_to} && find tmp/log -type f -exec rm -f \"{}\" \\;"
240
240
  end
241
241
 
242
+
243
+ desc "Uses configs in the app/platform directory to configure servers"
244
+ task :install, :roles =>[:host] do
245
+ config_check
246
+ needs_root
247
+ begin
248
+ with_user("root", "#{root_pass}") do
249
+ run "ln -s /etc/nginx/sites-enabled/#{user}.conf #{deploy_to}/app/platform/nginx.conf"
250
+ run "ln -s /etc/apache2/sites-enabled/#{user}.conf #{deploy_to}/app/platform/apache.conf"
251
+ end
252
+ user_cron_tasks = capture("cat #{deploy_to}/app/platform/crontab")
253
+ run write_crontab(user_cron_tasks)
254
+ rescue
255
+
256
+ end
257
+ end
258
+
259
+ def write_crontab(data)
260
+ tmp_cron_file = Tempfile.new('temp_cron').path
261
+ File.open(tmp_cron_file, File::WRONLY | File::APPEND) do |file|
262
+ file.puts data
263
+ end
264
+
265
+ command = ['crontab']
266
+ command << "-u #{user}" if defined? "#{user}"
267
+ command << tmp_cron_file
268
+
269
+ if system(command.join(' '))
270
+ puts "[write] crontab file updated"
271
+ exit
272
+ else
273
+ warn "[fail] couldn't write crontab"
274
+ exit(1)
275
+ end
276
+ end
277
+
242
278
 
243
279
  end
244
280
 
@@ -354,6 +390,10 @@ Capistrano::Configuration.instance(:must_exist).load do
354
390
  eval "#{os_ver}".testos
355
391
  end
356
392
 
393
+
394
+
395
+ end
396
+
357
397
 
358
398
  # =============================================================================
359
399
  # +MIGRATING+ APPLICATIONS
data/obbistrano.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{obbistrano}
5
- s.version = "1.1.58"
5
+ s.version = "1.1.59"
6
6
  s.authors = ["Ross Riley", "One Black Bear"]
7
7
  s.date = Time.now
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obbistrano
3
3
  version: !ruby/object:Gem::Version
4
- hash: 103
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 1
9
- - 58
10
- version: 1.1.58
8
+ - 59
9
+ version: 1.1.59
11
10
  platform: ruby
12
11
  authors:
13
12
  - Ross Riley
@@ -16,18 +15,16 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-05-23 00:00:00 +01:00
18
+ date: 2011-11-02 00:00:00 +00:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: capistrano
24
23
  prerelease: false
25
24
  requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
25
  requirements:
28
26
  - - ">="
29
27
  - !ruby/object:Gem::Version
30
- hash: 9
31
28
  segments:
32
29
  - 2
33
30
  - 5
@@ -38,11 +35,9 @@ dependencies:
38
35
  name: activeresource
39
36
  prerelease: false
40
37
  requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ">="
44
40
  - !ruby/object:Gem::Version
45
- hash: 7
46
41
  segments:
47
42
  - 2
48
43
  version: "2"
@@ -52,11 +47,9 @@ dependencies:
52
47
  name: httparty
53
48
  prerelease: false
54
49
  requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
50
  requirements:
57
51
  - - ">="
58
52
  - !ruby/object:Gem::Version
59
- hash: 9
60
53
  segments:
61
54
  - 0
62
55
  - 4
@@ -90,27 +83,23 @@ rdoc_options: []
90
83
  require_paths:
91
84
  - lib
92
85
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
86
  requirements:
95
87
  - - ">="
96
88
  - !ruby/object:Gem::Version
97
- hash: 3
98
89
  segments:
99
90
  - 0
100
91
  version: "0"
101
92
  required_rubygems_version: !ruby/object:Gem::Requirement
102
- none: false
103
93
  requirements:
104
94
  - - ">="
105
95
  - !ruby/object:Gem::Version
106
- hash: 3
107
96
  segments:
108
97
  - 0
109
98
  version: "0"
110
99
  requirements: []
111
100
 
112
101
  rubyforge_project:
113
- rubygems_version: 1.3.7
102
+ rubygems_version: 1.3.6
114
103
  signing_key:
115
104
  specification_version: 2
116
105
  summary: Adds extra namespaces to Capistrano to allow simple setup, deploys and maintenance.