capistrano-cul 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdf61bf425466ac1f834abf8e1b58c343d6ba6d9
4
- data.tar.gz: e4f56d47ce5e62884e0c4e3f9d695fdd09fa040f
3
+ metadata.gz: 3ba8aa2d215d9e7bd5a08cf20c9d2cc4b68612ca
4
+ data.tar.gz: b3991585daed81c5bab294d5ba67bb277730a5db
5
5
  SHA512:
6
- metadata.gz: e44a48f6094f3a73191ee75b321d2ab069b089404a56f00d484606614d3c5acd3d535c1721c41f50819710f2e385cc3306ce63b7331bb2b054bd0b55ace71189
7
- data.tar.gz: 8d256b5e8d83985d222b0dcd1522a3bac57cfbc146c7ef418c9232700152c9a76f7c6563e986474a7462bd7a1ba2f1249c9b97a738bd50405b80b4558541c6da
6
+ metadata.gz: 6b37fd6d3e4b6d71304f91629dfc1cd55bb34d5ee20b9e4df95331c645fe9d07335537d117850c395cf89840b49572a4897ef6347a8fe0b214bdea5f839cd3f2
7
+ data.tar.gz: d1406e40206bb9701a53cd9df10134b291a626abdc8acd6ed6c079c1942ccf2ebdb7c087c817d29e5af55db3321bdebf695ddc421d658ce0766a9d388c281439
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13
1
+ 0.0.14
@@ -50,14 +50,6 @@ namespace :cul do
50
50
  failure = true
51
51
  end
52
52
  end
53
- within fetch(:wp_docroot) do
54
- # Ensure that destination WordPress is running the latest version
55
- result = capture :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'core', 'check-update'
56
- unless result.index('Success')
57
- puts "Could not copy TO destination [#{fetch(:stage)}] WordPress because it is not running the latest version of WordPress. Please update [#{fetch(:stage)}] before running a copy operation."
58
- failure = true
59
- end
60
- end
61
53
  end
62
54
  next if failure # End if the previous checks failed
63
55
 
@@ -96,7 +88,7 @@ namespace :cul do
96
88
  execute :find, find_upload_dirs, ' >> ', path_to_list_of_files_to_copy
97
89
 
98
90
  # Print out which files won't be copied
99
- files_not_copied = capture(:comm, '-23', "<(find . -type f -path './uploads/*' -o -path './blogs.dir/*' | sort)", "<(find #{find_upload_dirs} | sort)")
91
+ files_not_copied = capture(:comm, '-23', "<(find . -type f \\( -path './uploads/*' -o -path './blogs.dir/*' \\) | sort)", "<(find #{find_upload_dirs} | sort)")
100
92
 
101
93
  puts (
102
94
  "The following files will not be copied:\n" +
@@ -179,8 +171,6 @@ namespace :cul do
179
171
  else
180
172
  puts '- Skipping search and replace because neither "y" nor "yes" were entered.'
181
173
  end
182
-
183
- puts "\nCopy operation complete!"
184
174
  end
185
175
 
186
176
  # Next, install all plugins and themes from src wordpress, matching all versions and active vs. inactive plugin and theme states
@@ -196,40 +186,39 @@ namespace :cul do
196
186
 
197
187
  # Within dest wp instance, install specifically versioned plugins and themes
198
188
  within File.join(fetch(:wp_docroot)) do
199
- # Get list of already-installed plugins and themes (from dest instance) so that we don't attempt to reinstall them
200
- already_installed_plugin_names = JSON.parse(capture(:wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'plugin', 'list', '--fields=name,version,status', '--format=json')).map{|plugin_info| plugin_info['name']}
201
- already_installed_theme_names = JSON.parse(capture(:wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'theme', 'list', '--fields=name,version,status', '--format=json')).map{|theme_info| theme_info['name']}
189
+ # Get list of repo-managed plugins and themes so that we don't attempt to overwrite these directories
190
+ repo_managed_plugin_names = fetch(:wp_custom_plugins, {}).keys
191
+ repo_managed_theme_names = fetch(:wp_custom_themes, {}).keys
202
192
 
203
- puts 'Already installed plugins: ' + already_installed_plugin_names.inspect
204
- puts 'Already installed themes: ' + already_installed_theme_names.inspect
193
+ puts "Downloading new copies of non-repo-managed plugins and themes..."
205
194
 
206
- data_for_plugins.delete_if{|plugin_info| already_installed_plugin_names.include?(plugin_info['name']) }.each do |plugin_info|
195
+ data_for_plugins.delete_if{|plugin_info| repo_managed_plugin_names.include?(plugin_info['name']) }.each do |plugin_info|
207
196
  name = plugin_info['name']
208
197
  version = plugin_info['version']
209
198
  status = plugin_info['status']
210
199
 
211
200
  case status
212
201
  when 'active'
213
- execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}", '--activate'
202
+ execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}", '--activate'
214
203
  when 'active-network'
215
- execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}", '--activate-network'
204
+ execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}", '--activate-network'
216
205
  when 'inactive'
217
- execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}"
206
+ execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'plugin', 'install', name, "--version=#{version}"
218
207
  when 'must-use'
219
208
  puts "--- WARNING: must-use plugin #{name} was not migrated over. It should be put in your blog's repository and deployed through a regular deployment."
220
209
  end
221
210
  end
222
211
 
223
- data_for_themes.delete_if{|theme_info| already_installed_theme_names.include?(theme_info['name']) }.each do |theme_info|
212
+ data_for_themes.delete_if{|theme_info| repo_managed_theme_names.include?(theme_info['name']) }.each do |theme_info|
224
213
  name = theme_info['name']
225
214
  version = theme_info['version']
226
215
  status = theme_info['status']
227
216
 
228
217
  case status
229
218
  when 'active'
230
- execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'theme', 'install', name, "--version=#{version}", '--activate'
231
- when 'inactive'
232
- execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'theme', 'install', name, "--version=#{version}"
219
+ execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'theme', 'install', name, "--version=#{version}", '--activate'
220
+ when 'inactive', 'parent'
221
+ execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'theme', 'install', name, "--version=#{version}"
233
222
  end
234
223
  end
235
224
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-cul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carla Galarza
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-02-05 00:00:00.000000000 Z
12
+ date: 2018-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano