production-sync 0.1.1 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme +10 -1
- data/lib/production-sync/version.rb +1 -1
- data/lib/production-sync.rb +4 -2
- metadata +2 -2
data/Readme
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
Production Sync
|
2
2
|
---------------
|
3
3
|
|
4
|
-
A simple rsync wrapper allowing you to configure "sites" that can be rsync'd up to a remote server via SSH
|
4
|
+
A simple rsync wrapper allowing you to configure "sites" that can be rsync'd up to a remote server via SSH
|
5
|
+
|
6
|
+
Sample Config Entry
|
7
|
+
|
8
|
+
live_server:
|
9
|
+
server: server.com
|
10
|
+
username: username
|
11
|
+
source: /Users/home_folder
|
12
|
+
destination: /home/user/remote_location
|
13
|
+
#ignore_file: .something_else
|
data/lib/production-sync.rb
CHANGED
@@ -44,13 +44,15 @@ module ProductionSync
|
|
44
44
|
|
45
45
|
#Sanitize the / at the end of destination, we don't check to see if this exists
|
46
46
|
@site['destination'] += "/" if @site['destination'][-1,1] != "/"
|
47
|
-
|
48
47
|
|
48
|
+
#Default to .rsyncignore, but this can be configured, it could be configured to .gitignore
|
49
|
+
@ignore_file = @site['ignore_file'] || ".rsyncignore"
|
50
|
+
|
49
51
|
end
|
50
52
|
|
51
53
|
#Define the command to run
|
52
54
|
def command
|
53
|
-
@command = "#{@rsync} -rv --delete --exclude '.git' --exclude '.svn' --exclude '.gitignore' --exclude '.rsyncignore' --exclude-from #{@site['source']
|
55
|
+
@command = "#{@rsync} -rv --delete --exclude '.git' --exclude '.svn' --exclude '.gitignore' --exclude '.rsyncignore' --exclude-from #{@site['source']}/#{@ignore_file} #{File.expand_path(@site['source']) + "/"} #{@site['username']}@#{@site['server']}:#{@site['destination']}"
|
54
56
|
end
|
55
57
|
|
56
58
|
#Run the command
|