capistrano-cul 0.0.4 → 0.0.5

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: c51781e97ebb29d0ee0c4c0ea4fb2e3fe508882a
4
- data.tar.gz: 46a13fcc3c8074922404b750f488ec40913cee65
3
+ metadata.gz: 0143c8d36da076a4fff5fe65da655f52a66c9f00
4
+ data.tar.gz: 605697273391a1ce2ab01af9db1104043eb2dcac
5
5
  SHA512:
6
- metadata.gz: 855b84d312100e3a9666292fc95e01ec93495a60cd6dc17f49a194d78f22d51c083ffe3760d20ced9a787000811e545ad0314397c197c324ad776a5e52cdacd2
7
- data.tar.gz: 9a20ca3d7022fbb03cc0e85ab25d3c4a1ea0fb3d8f486cf4d95dbeb4021eb60499481b1d104ec000414f53dae9b7c25d7cef0e290219112d420ae56885075f8b
6
+ metadata.gz: 70c576dbcea722dfb80564788f34235a492e95870d85b79e412ddcce32d02ce12259bca90792032d5d449e91b56c00612be426084020ac8c2e7abb9c877a8179
7
+ data.tar.gz: f974464b50c4ede35881436643b2dcbcab4799dc41fba7d155609dcc01159c9d526729d64011ab4699c25c7f435d2dc6b78afeafca1d7f23ecf4a43d7f67f630
data/README.md CHANGED
@@ -57,16 +57,19 @@ require 'capistrano/cul/wp'
57
57
  3. `cap {env} cul:wp:symlink_custom_plugins_and_themes`
58
58
 
59
59
  Creates symlinks for custom plugins and themes as part of a WordPress deployment. Generally run as an `after :deploy` hook.
60
- 4. `cap {env} cul:wp:update:core`
60
+ 4. `cap {env} cul:wp:searchreplace`
61
+
62
+ Runs a search and replace operation on the tables in a WordPress installation.
63
+ 5. `cap {env} cul:wp:update:core`
61
64
 
62
65
  Updates WordPress core to the latest version.
63
- 5. `cap {env} cul:wp:update:plugins`
66
+ 6. `cap {env} cul:wp:update:plugins`
64
67
 
65
68
  Updates non-repo-managed plugins to the latest version.
66
- 6. `cap {env} cul:wp:update:themes`
69
+ 7. `cap {env} cul:wp:update:themes`
67
70
 
68
71
  Updates non-repo-managed themes to the latest version.
69
- 7. `cap {env} cul:wp:update:all`
72
+ 8. `cap {env} cul:wp:update:all`
70
73
 
71
74
  Updates WordPress core, plugins, and themes (in that order) by calling update:core, update:plugins and update:themes tasks.
72
75
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -85,7 +85,7 @@ namespace :cul do
85
85
  task :install do
86
86
  puts "Please provide administrative credentials:"
87
87
  ask(:admin_user, "Admin username:")
88
- ask(:admin_password, "Admin password:")
88
+ ask(:admin_password, "Admin password:", echo: false)
89
89
  ask(:admin_email, "Admin email:")
90
90
 
91
91
  require_cap_params!([:url, :title, :admin_user, :admin_password, :admin_email])
@@ -144,5 +144,26 @@ namespace :cul do
144
144
  end
145
145
  end
146
146
  end
147
+
148
+ desc "Runs a search and replace operation on the tables in a WordPress installation"
149
+ task :searchreplace do
150
+ on roles(:web) do
151
+ within fetch(:wp_docroot) do
152
+ set :search_string, ask("search string")
153
+ set :replacement_string, ask("replacement string")
154
+ puts "Are you sure you want to replace all occurrences of \"#{fetch(:search_string)}\" with \"#{fetch(:replacement_string)}\"?"
155
+ set :confirm, ask('"y" or "yes" to continue')
156
+ if fetch(:confirm) == 'y' || fetch(:confirm) == 'yes'
157
+ puts 'Running search and replace. This may take a while for large databases...'
158
+ start_time = Time.now
159
+ #execute :wp, 'search-replace', "'#{search_string}'", "'#{replacement_string}'", '--skip-columns=guid'
160
+ execute :wp, 'search-replace', "'#{fetch(:search_string)}'", "'#{fetch(:replacement_string)}'", '--skip-columns=guid'
161
+ puts "Search and replace complete (took #{(Time.now - start_time).to_s} seconds)"
162
+ else
163
+ puts 'Search and replace operation has been cancelled because "y" or "yes" were not entered.'
164
+ end
165
+ end
166
+ end
167
+ end
147
168
  end
148
169
  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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carla Galarza