capistrano-content 0.0.3 → 0.0.4

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.
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = 'capistrano-content'
15
15
  gem.require_paths = ['lib']
16
- gem.version = '0.0.3'
16
+ gem.version = '0.0.4'
17
17
 
18
18
  # Runtime dependencies
19
19
  gem.add_dependency 'rake'
@@ -14,9 +14,10 @@ Capistrano::Configuration.instance(:must_exist).load do
14
14
 
15
15
  desc 'Import content'
16
16
  task :import, :roles => :app do
17
+ tmp_file = random_tmp_file
18
+ on_rollback { run "rm -f #{tmp_file}" }
19
+
17
20
  transaction do
18
- tmp_file = random_tmp_file
19
- on_rollback { run "rm -f #{tmp_file}" }
20
21
  backup
21
22
  write File.read(arguments), tmp_file
22
23
  run <<-CMD
@@ -24,6 +25,7 @@ Capistrano::Configuration.instance(:must_exist).load do
24
25
  tar xf #{tmp_file} &&
25
26
  rm -f #{tmp_file}
26
27
  CMD
28
+ clean
27
29
  end
28
30
  end
29
31
 
@@ -32,6 +34,7 @@ Capistrano::Configuration.instance(:must_exist).load do
32
34
  tmp_file = "#{random_tmp_file}.tar.gz"
33
35
  on_rollback { run "rm -f #{fetch :latest_content_backup}" }
34
36
  on_rollback { run_locally "rm -f #{tmp_file}" }
37
+
35
38
  transaction do
36
39
  backup
37
40
  download fetch(:latest_content_backup), tmp_file
@@ -46,10 +49,14 @@ Capistrano::Configuration.instance(:must_exist).load do
46
49
  "#{fetch :backup_path, "#{fetch :deploy_to}/backups"}/#{fetch :application}_shared_contents_#{Time.now.strftime('%d-%m-%Y_%H-%M-%S')}.tar.gz"
47
50
  on_rollback { run "rm -f #{fetch :latest_content_backup}" }
48
51
 
49
- run <<-CMD
50
- cd #{fetch :shared_content_path} &&
51
- tar chzf #{fetch :latest_content_backup} --exclude='*~' --exclude='*.tmp' --exclude='*.bak' *
52
- CMD
52
+ transaction do
53
+ clean
54
+
55
+ run <<-CMD
56
+ cd #{fetch :shared_content_path} &&
57
+ tar chzf #{fetch :latest_content_backup} *
58
+ CMD
59
+ end
53
60
  end
54
61
 
55
62
  desc '[internal] Link content folders'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -2416752865718671562
96
+ hash: 3066291368283746188
97
97
  requirements: []
98
98
  rubyforge_project:
99
99
  rubygems_version: 1.8.23