trak3r / iphone-rdoc-template

An RDoc template which looks better on the iPhone web browser. See the Rails example at http://pocketrails.com

This URL has Read+Write access

iphone-rdoc-template / config / deploy.rb
100644 48 lines (39 sloc) 1.101 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
role :site, 'pocketrails.com'
role :local, 'localhost'
 
DESKTOP_PATH = "/Users/ted/Desktop"
PROJECT_PATH = "#{DESKTOP_PATH}/iPhone/personal projects/pocketrails/iphone-rdoc-template"
RAILS_PATH = "#{PROJECT_PATH}/../rails"
RDOC_PATH = "#{RAILS_PATH}/doc/rdoc"
REMOTE_PATH = "~/pocketrails.com"
ZIPPED_FILE = "pocketrails.tgz"
 
desc "Compress the files locally."
task :gzip, :roles => :local do
  run "cd '#{RDOC_PATH}' && tar cvzf '#{ZIPPED_FILE}' *"
end
 
desc "Copy the zip file to the server."
task :scp, :roles => :site do
  upload "#{RDOC_PATH}/#{ZIPPED_FILE}", "#{REMOTE_PATH}", :via => :scp
end
 
desc "Decompress the file remotely."
task :gunzip, :roles => :site do
  run "cd #{REMOTE_PATH} && tar xvzf #{ZIPPED_FILE}"
end
 
desc "Regenerate the sitemap XML."
task :sitemap, :roles => :site do
  run "cd sitemap_gen && ./sitemap_gen.py --config=config.xml"
end
 
task :deploy do
  gzip
  scp
  gunzip
end
 
[ 'gzip' ].each do |task|
  before "#{task}" do
    set :user, 'ted'
  end
end
 
[ 'scp', 'gunzip', 'sitemap' ].each do |task|
  before "#{task}" do
    set :user, 'teflonted'
  end
end