@@ -96,20 +96,16 @@ group :tree do
96
96
file . write "- /*\n "
97
97
end
98
98
99
- guard_options = {
100
- :source => "#{ barclamp . to_s } /" ,
101
- :destination => target ,
102
- :user => user ,
103
- :remote_address => host ,
104
- :remote_port => port ,
105
- :exclude_from => exclude_tree ,
106
- :sync_on_start => true ,
107
- :ssh => true ,
108
- :cvs_exclude => true ,
109
- :delete => false
110
- }
111
-
112
- guard ( "remote-sync" , guard_options ) do
99
+ guard_params = [
100
+ "-ar --stats --cvs-exclude" ,
101
+ "--chown 'crowbar:crowbar'" ,
102
+ "--exclude-from '#{ exclude_tree } '" ,
103
+ "-e 'ssh -p #{ port } '" ,
104
+ "#{ barclamp . to_s } /" ,
105
+ "#{ user } @#{ host } :#{ target } "
106
+ ]
107
+
108
+ guard "remote-sync" , sync_on_start : true , source : "#{ barclamp . to_s } /" , cli_options : guard_params . join ( " " ) do
113
109
watch ( /\A #{ barclamp . to_s } \/ .+/ )
114
110
end
115
111
@@ -119,7 +115,7 @@ group :tree do
119
115
)
120
116
121
117
File . open ( exclude_barclamp , "w" ) do |file |
122
- file . write "+ /crowbar .yml\n "
118
+ file . write "+ /* .yml\n "
123
119
file . write "+ /Gemfile\n "
124
120
file . write "+ /Rakefile\n "
125
121
file . write "+ /README.md\n "
@@ -131,21 +127,16 @@ group :tree do
131
127
file . write "- /*\n "
132
128
end
133
129
134
- config_options = {
135
- :source => "#{ barclamp . to_s } /" ,
136
- :destination => File . join ( target , barclamp . to_s ) ,
137
- :user => user ,
138
- :remote_address => host ,
139
- :remote_port => port ,
140
- :exclude_from => exclude_barclamp ,
141
- :exclude_from => nil ,
142
- :include_from => nil ,
143
- :sync_on_start => true ,
144
- :ssh => true ,
145
- :cvs_exclude => true
146
- }
147
-
148
- guard ( "remote-sync" , config_options ) do
130
+ config_params = [
131
+ "-ar --stats --cvs-exclude --delete" ,
132
+ "--chown 'crowbar:crowbar'" ,
133
+ "--exclude-from '#{ exclude_barclamp } '" ,
134
+ "-e 'ssh -p #{ port } '" ,
135
+ "#{ barclamp . to_s } /" ,
136
+ "#{ user } @#{ host } :#{ File . join ( target , barclamp . to_s ) } "
137
+ ]
138
+
139
+ guard "remote-sync" , sync_on_start : true , source : "#{ barclamp . to_s } /" , cli_options : config_params . join ( " " ) do
149
140
watch ( /\A #{ barclamp . to_s } \/ .+/ )
150
141
end
151
142
end
@@ -171,19 +162,16 @@ group :script do
171
162
file . write "- /*\n "
172
163
end
173
164
174
- script_options = {
175
- :source => "scripts/" ,
176
- :destination => target ,
177
- :user => user ,
178
- :remote_address => host ,
179
- :remote_port => port ,
180
- :exclude_from => exclude_script ,
181
- :sync_on_start => true ,
182
- :ssh => true ,
183
- :cvs_exclude => true
184
- }
185
-
186
- guard ( "remote-sync" , script_options ) do
165
+ script_params = [
166
+ "-ar --stats --cvs-exclude --delete" ,
167
+ "--chown 'crowbar:crowbar'" ,
168
+ "--exclude-from '#{ exclude_script } '" ,
169
+ "-e 'ssh -p #{ port } '" ,
170
+ "scripts/" ,
171
+ "#{ user } @#{ host } :#{ target } "
172
+ ]
173
+
174
+ guard "remote-sync" , sync_on_start : true , source : "scripts/" , cli_options : script_params . join ( " " ) do
187
175
watch ( /\A scripts\/ barclamp_.+\z / )
188
176
watch ( /\A scripts\/ json\- .+\z / )
189
177
watch ( /\A scripts\/ install\- .+\z / )
@@ -208,19 +196,16 @@ group :mirror do
208
196
file . write "- *.swp\n "
209
197
end
210
198
211
- mirror_options = {
212
- :source => "barclamps/" ,
213
- :destination => target ,
214
- :user => user ,
215
- :remote_address => host ,
216
- :remote_port => port ,
217
- :exclude_from => exclude_mirror ,
218
- :sync_on_start => true ,
219
- :ssh => true ,
220
- :cvs_exclude => true
221
- }
222
-
223
- guard ( "remote-sync" , mirror_options ) do
199
+ mirror_params = [
200
+ "-ar --stats --cvs-exclude --delete" ,
201
+ "--chown 'crowbar:crowbar'" ,
202
+ "--exclude-from '#{ exclude_mirror } '" ,
203
+ "-e 'ssh -p #{ port } '" ,
204
+ "barclamps/" ,
205
+ "#{ user } @#{ host } :#{ target } "
206
+ ]
207
+
208
+ guard "remote-sync" , sync_on_start : true , source : "barclamps/" , cli_options : mirror_params . join ( " " ) do
224
209
watch ( /\A barclamps\/ .+/ )
225
210
end
226
211
end
0 commit comments