capistrano-exts 1.9.0 → 1.10.0

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.md CHANGED
@@ -18,7 +18,7 @@ gem install capistrano-exts
18
18
  or add it to your Gemfile
19
19
 
20
20
  ```ruby
21
- gem 'capistrano-exts', '>=1.9.0', :require => false
21
+ gem 'capistrano-exts', '>=1.10.0', :require => false
22
22
  ```
23
23
 
24
24
  # Setup
@@ -64,8 +64,18 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  set :contents_folder, {
67
- 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
- }
67
+ 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
+ }
69
+
70
+ # Here you can define which files/folder you would like to keep, these files
71
+ # and folders are not considered contents so they will not be synced from one
72
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
73
+ # between versions in the shared/items folder
74
+ set :shared_items, [
75
+ 'public/.htaccess',
76
+ 'public/sitemap.xml',
77
+ 'public/robots.txt',
78
+ ]
69
79
 
70
80
  #
71
81
  #
@@ -64,8 +64,18 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  set :contents_folder, {
67
- 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
- }
67
+ 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
+ }
69
+
70
+ # Here you can define which files/folder you would like to keep, these files
71
+ # and folders are not considered contents so they will not be synced from one
72
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
73
+ # between versions in the shared/items folder
74
+ set :shared_items, [
75
+ 'public/.htaccess',
76
+ 'public/sitemap.xml',
77
+ 'public/robots.txt',
78
+ ]
69
79
 
70
80
  #
71
81
  #
@@ -64,8 +64,18 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  set :contents_folder, {
67
- 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
- }
67
+ 'contenu' => "#{fetch :public_path}/tl_files/durable/contenu",
68
+ }
69
+
70
+ # Here you can define which files/folder you would like to keep, these files
71
+ # and folders are not considered contents so they will not be synced from one
72
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
73
+ # between versions in the shared/items folder
74
+ set :shared_items, [
75
+ 'public/.htaccess',
76
+ 'public/sitemap.xml',
77
+ 'public/robots.txt',
78
+ ]
69
79
 
70
80
  #
71
81
  #
@@ -64,10 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
70
-
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
71
80
  #
72
81
  #
73
82
  #############
@@ -64,9 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
70
80
 
71
81
  #
72
82
  #
@@ -64,9 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
70
80
 
71
81
  #
72
82
  #
@@ -64,9 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
70
80
 
71
81
  #
72
82
  #
@@ -64,9 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
70
80
 
71
81
  #
72
82
  #
@@ -64,9 +64,19 @@ set :rvm_ruby_string, "1.9.3"
64
64
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
65
65
  # you can use public_path/current_path/deploy_to etc...
66
66
  # set :contents_folder, {
67
- # 'image' => "#{fetch :public_path}/images",
68
- # 'video' => "#{fetch :public_path}/videos",
69
- # }
67
+ # 'image' => "#{fetch :public_path}/images",
68
+ # 'video' => "#{fetch :public_path}/videos",
69
+ # }
70
+
71
+ # Here you can define which files/folder you would like to keep, these files
72
+ # and folders are not considered contents so they will not be synced from one
73
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
74
+ # between versions in the shared/items folder
75
+ # set :shared_items, [
76
+ # 'public/.htaccess',
77
+ # 'public/sitemap.xml',
78
+ # 'public/robots.txt',
79
+ # ]
70
80
 
71
81
  #
72
82
  #
@@ -64,21 +64,6 @@ Capistrano::Configuration.instance(:must_exist).load do
64
64
  end
65
65
  end
66
66
 
67
- desc "[internal] Setup .htaccess"
68
- task :setup_htaccess do
69
- unless remote_file_exists?("#{fetch :shared_path}/config/htaccess.txt")
70
- begin
71
- run <<-CMD
72
- #{try_sudo} cp #{fetch :latest_release}/public/.htaccess.default #{fetch :shared_path}/config/htaccess.txt
73
- CMD
74
- rescue Capistrano::CommandError
75
- run <<-CMD
76
- #{try_sudo} touch #{fetch :shared_path}/config/htaccess.txt
77
- CMD
78
- end
79
- end
80
- end
81
-
82
67
  desc "[internal] Fix contao's symlinks to the shared path"
83
68
  task :fix_links, :roles => :app, :except => { :no_release => true } do
84
69
  latest_release = fetch :latest_release
@@ -87,13 +72,11 @@ Capistrano::Configuration.instance(:must_exist).load do
87
72
  # Remove files
88
73
  run <<-CMD
89
74
  #{try_sudo} rm -rf #{latest_release}/public/system/logs &&
90
- #{try_sudo} rm -f #{latest_release}/public/system/config/localconfig.php &&
91
- #{try_sudo} rm -f #{latest_release}/public/.htaccess
75
+ #{try_sudo} rm -f #{latest_release}/public/system/config/localconfig.php
92
76
  CMD
93
77
 
94
78
  # Create symlinks
95
79
  run <<-CMD
96
- #{try_sudo} ln -nsf #{shared_path}/config/htaccess.txt #{latest_release}/public/.htaccess &&
97
80
  #{try_sudo} ln -nsf #{shared_path}/config/localconfig.php #{latest_release}/public/system/config/localconfig.php &&
98
81
  #{try_sudo} ln -nsf #{shared_path}/logs #{latest_release}/public/system/logs
99
82
  CMD
@@ -104,7 +87,6 @@ Capistrano::Configuration.instance(:must_exist).load do
104
87
  after "deploy:setup", "contao:setup"
105
88
  after "contao:setup", "contao:setup_localconfig"
106
89
  after "deploy:finalize_update", "contao:fix_links"
107
- before "contao:fix_links", "contao:setup_htaccess"
108
90
 
109
91
  # Mysql Credentials
110
92
  before "contao:setup_localconfig", "mysql:credentials"
@@ -38,7 +38,8 @@ Capistrano::Configuration.instance(:must_exist).load do
38
38
 
39
39
  run <<-CMD
40
40
  mkdir -p #{fetch :deploy_to} &&
41
- mkdir -p #{backup_path}
41
+ mkdir -p #{backup_path} &&
42
+ mkdir -p #{fetch :shared_path}/items
42
43
  CMD
43
44
 
44
45
  if exists? :logs_path
@@ -72,6 +73,39 @@ Capistrano::Configuration.instance(:must_exist).load do
72
73
 
73
74
  puts "The public folders has been moved to the old folder"
74
75
  end
76
+
77
+ desc "Shared items"
78
+ task :shared_items, :roles => :app, :except => { :no_release => true } do
79
+ if exists?(:shared_items)
80
+ shared_items = fetch :shared_items
81
+ shared_path = fetch :shared_path
82
+ latest_release = fetch :latest_release
83
+
84
+ shared_items.each do |f|
85
+ file_name = f.gsub(/\//, '_')
86
+ unless remote_file_exists?("#{shared_path}/items/#{file_name}")
87
+ begin
88
+ run <<-CMD
89
+ #{try_sudo} cp #{latest_release}/#{f} #{shared_path}/items/#{file_name}
90
+ CMD
91
+ rescue Capistrano::CommandError
92
+ run <<-CMD
93
+ #{try_sudo} touch #{shared_path}/items/#{file_name}
94
+ CMD
95
+ puts "WARNING: You should edit #{shared_path}/items/#{file_name}"
96
+ end
97
+ end
98
+
99
+ begin
100
+ run <<-CMD
101
+ #{try_sudo} ln -nsf #{shared_path}/items/#{file_name} #{latest_release}/#{f}
102
+ CMD
103
+ rescue Capistrano::CommandError
104
+ abort "Unable to create a link for '#{shared_path}/items/#{file_name}' at '#{latest_release}/#{f}'"
105
+ end
106
+ end
107
+ end
108
+ end
75
109
  end
76
110
 
77
111
  # Dependencies
@@ -79,4 +113,5 @@ Capistrano::Configuration.instance(:must_exist).load do
79
113
  after "deploy:restart", "deploy:fix_permissions"
80
114
  after "deploy:setup", "deploy:folders"
81
115
  after "deploy:setup", "deploy:symlink_public_folders"
116
+ after "deploy:finalize_update", "deploy:shared_items"
82
117
  end
@@ -61,9 +61,19 @@ set :rvm_ruby_string, "1.9.3"
61
61
  # created under 'shared_path/contents' and symlinked to the value (absolute path)
62
62
  # you can use public_path/current_path/deploy_to etc...
63
63
  # set :contents_folder, {
64
- # 'image' => "#{fetch :public_path}/images",
65
- # 'video' => "#{fetch :public_path}/videos",
66
- # }
64
+ # 'image' => "#{fetch :public_path}/images",
65
+ # 'video' => "#{fetch :public_path}/videos",
66
+ # }
67
+
68
+ # Here you can define which files/folder you would like to keep, these files
69
+ # and folders are not considered contents so they will not be synced from one
70
+ # server to another with the tasks mulltistage:sync:* instead they will be kept
71
+ # between versions in the shared/items folder
72
+ # set :shared_items, [
73
+ # 'public/.htaccess',
74
+ # 'public/sitemap.xml',
75
+ # 'public/robots.txt',
76
+ # ]
67
77
 
68
78
  #
69
79
  #
@@ -2,7 +2,7 @@ module Capistrano
2
2
  module Extensions
3
3
  module Version #:nodoc:
4
4
  MAJOR = 1
5
- MINOR = 9
5
+ MINOR = 10
6
6
  TINY = 0
7
7
 
8
8
  ARRAY = [MAJOR, MINOR, TINY]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-exts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-12 00:00:00.000000000 Z
12
+ date: 2011-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &2151803400 !ruby/object:Gem::Requirement
16
+ requirement: &2153165220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.8.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151803400
24
+ version_requirements: *2153165220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: i18n
27
- requirement: &2151801460 !ruby/object:Gem::Requirement
27
+ requirement: &2153164720 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.6.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2151801460
35
+ version_requirements: *2153164720
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &2151799900 !ruby/object:Gem::Requirement
38
+ requirement: &2153164260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.1.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2151799900
46
+ version_requirements: *2153164260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &2151798720 !ruby/object:Gem::Requirement
49
+ requirement: &2153163800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.6.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2151798720
57
+ version_requirements: *2153163800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-bundler
60
- requirement: &2153407400 !ruby/object:Gem::Requirement
60
+ requirement: &2153163340 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.1.3
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2153407400
68
+ version_requirements: *2153163340
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-rspec
71
- requirement: &2153406580 !ruby/object:Gem::Requirement
71
+ requirement: &2153162880 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.4.3
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2153406580
79
+ version_requirements: *2153162880
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &2153405280 !ruby/object:Gem::Requirement
82
+ requirement: &2153162420 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: 2.6.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2153405280
90
+ version_requirements: *2153162420
91
91
  description: ! 'Capistrano exts is a set of helper tasks to help with the initial
92
92
  server
93
93