-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
30 lines (26 loc) · 980 Bytes
/
Rakefile
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
# Settings
user = 'bridgepdx'
host = 'opensourcebridge.org'
path = '/var/www/bridgepdx_wordpress/wp-content/themes/osbp_wordpress_theme_v3/'
# Derived settings
remote = "#{user}@#{host}:#{path}"
# rsync: (v)erbose e(x)clude-other-devices (r)ecursive preserve-sym(l)inks preserve-(p)ermissions preserve-(D)evices
rsync = 'rsync --checksum -vxrlpD --progress --exclude=.* --exclude=*~ --exclude=*.swp --exclude=Rakefile --exclude=my_common_styles_url.txt* --exclude=shared_fragments'
desc "Show help"
task :help do
puts <<-HERE
Tasks:
* deploy => Deploys files to production server
* fetch => Copies files from production server
HERE
end
task :default => :help
desc "Deploys common style files using rsync"
task :deploy do
sh "#{rsync} . #{remote}"
sh "ssh #{user}@#{host} 'chgrp -R #{user} #{path}; chmod -R ug+rwX #{path}'"
end
desc "Copy deployed files from remote into this directory -- will overwrite your files here"
task :fetch do
sh "#{rsync} #{remote} ."
end