capistrano-maven 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -224,15 +224,25 @@ module Capistrano
224
224
  abort("execution failure") unless system(cmd)
225
225
  }
226
226
 
227
+ _cset(:mvn_tar, 'tar')
228
+ _cset(:mvn_tar_local, 'tar')
229
+ _cset(:mvn_target_archive) {
230
+ "#{mvn_target_path}.tar.gz"
231
+ }
232
+ _cset(:mvn_target_archive_local) {
233
+ "#{mvn_target_path_local}.tar.gz"
234
+ }
227
235
  task(:upload_locally, :roles => :app, :except => { :no_release => true }) {
228
236
  on_rollback {
229
- run("rm -rf #{mvn_target_path}")
230
- }
231
- run_locally("test -d #{mvn_target_path_local}")
232
- run("mkdir -p #{mvn_target_path}")
233
- find_servers_for_task(current_task).each { |server|
234
- run_locally("rsync -lrt --chmod=u+rwX,go+rX #{mvn_target_path_local}/ #{user}@#{server.host}:#{mvn_target_path}/")
237
+ run("rm -rf #{mvn_target_path} #{mvn_target_archive}")
235
238
  }
239
+ begin
240
+ run_locally("cd #{File.dirname(mvn_target_path_local)} && #{mvn_tar_local} chzf #{mvn_target_archive_local} #{File.basename(mvn_target_path_local)}")
241
+ upload(mvn_target_archive_local, mvn_target_archive)
242
+ run("cd #{File.dirname(mvn_target_path)} && #{mvn_tar} xzf #{mvn_target_archive} && rm -f #{mvn_target_archive}")
243
+ ensure
244
+ run_locally("rm -f #{mvn_target_archive_local}")
245
+ end
236
246
  }
237
247
  }
238
248
  }
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Maven
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-maven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-10 00:00:00.000000000 Z
12
+ date: 2012-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano