capistrano-cul 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/capistrano/tasks/wp/migrate.cap +17 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aee9fde1f54ad0c8f89d94c98df402199ebeee9c
|
4
|
+
data.tar.gz: 89a002fa4f392e19f249a8f7350cd0bf07ac7ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e69bcd9605b16c1e5098d4415bf9e24777db139dd2914dfbb583c8396fdedd73baee20828af9461fce0d7cdfb78c30f29bb8214ddce3e89e974231ef67bc8af8
|
7
|
+
data.tar.gz: 5126b5b9a7bd5f5b5523f45dc4176435941fb7ac43d915b6559c9f401e2dc912fd58916fc8c752ed9d306faf47c5104bd855aa049c0a71e0405caf221e8f78b3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
@@ -7,10 +7,20 @@ namespace :cul do
|
|
7
7
|
|
8
8
|
require_cap_params!([:wp_docroot, :wp_content_path])
|
9
9
|
|
10
|
+
if fetch(:multisite, false)
|
11
|
+
puts "Since this is a multisite, you'll need to specify the source instance multisite url to continue:"
|
12
|
+
set :source_site_multisite_url, ask('source multisite full install url (e.g. https://blogs.cul.columbia.edu)')
|
13
|
+
fetch(:source_site_multisite_url)
|
14
|
+
|
15
|
+
puts "And you'll also need to specify the destination instance multisite url to continue:"
|
16
|
+
set :destination_site_multisite_url, ask('destination multisite full install url (e.g. https://blogs-dev.cul.columbia.edu)')
|
17
|
+
fetch(:destination_site_multisite_url)
|
18
|
+
end
|
19
|
+
|
10
20
|
# TODO: Verify that destination wordpress has already had the setup and deploy tasks run for it
|
11
21
|
set :src_wp_docroot, ask("server path to source WordPress installation (to copy from)")
|
12
22
|
#set :src_wp_docroot, '/cul/cul0/lito/vmounts/haydn/var-www/kennedyprize/html'
|
13
|
-
#set :src_wp_docroot, '/cul/cul0/ldpd/culblogs
|
23
|
+
#set :src_wp_docroot, '/cul/cul0/ldpd/culblogs/prod/ssl-html'
|
14
24
|
|
15
25
|
# Confirm operation because it is destructive
|
16
26
|
puts "\nWARNING: This operation will obliterate all content in environment [#{fetch(:stage)}] and replace it with content from [#{fetch(:src_wp_docroot)}]."
|
@@ -25,7 +35,7 @@ namespace :cul do
|
|
25
35
|
on roles(:web) do
|
26
36
|
within fetch(:src_wp_docroot) do
|
27
37
|
# Ensure that source WordPress is running the latest version
|
28
|
-
result = capture :wp, 'core', 'check-update'
|
38
|
+
result = capture :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'core', 'check-update'
|
29
39
|
unless result.index('Success')
|
30
40
|
puts 'Could not copy from source WordPress because it is not running the latest version of WordPress. Please update source before running a copy operation.'
|
31
41
|
end
|
@@ -33,13 +43,12 @@ namespace :cul do
|
|
33
43
|
|
34
44
|
within fetch(:wp_docroot) do
|
35
45
|
# Ensure that destination WordPress is running the latest version
|
36
|
-
result = capture :wp, 'core', 'check-update'
|
46
|
+
result = capture :wp, (fetch(:multisite, false) ? "--url=#{fetch(:destination_site_multisite_url)}" : ''), 'core', 'check-update'
|
37
47
|
unless result.index('Success')
|
38
48
|
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."
|
39
49
|
end
|
40
50
|
end
|
41
51
|
end
|
42
|
-
|
43
52
|
on roles(:web) do
|
44
53
|
|
45
54
|
db_export_tempfile_path = ''
|
@@ -49,7 +58,7 @@ namespace :cul do
|
|
49
58
|
|
50
59
|
# Export source WP DB to a temporary file
|
51
60
|
db_export_tempfile_path = Dir::Tmpname.make_tmpname '/tmp/', 'db_export_tempfile.sql'
|
52
|
-
execute :wp, 'db', 'export', db_export_tempfile_path
|
61
|
+
execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:source_site_multisite_url)}" : ''), 'db', 'export', db_export_tempfile_path
|
53
62
|
end
|
54
63
|
|
55
64
|
within fetch(:wp_docroot) do
|
@@ -110,9 +119,9 @@ namespace :cul do
|
|
110
119
|
invoke 'cul:wp:symlink_custom_plugins_and_themes'
|
111
120
|
|
112
121
|
# Make docroot readable and executable for "other" user so nginx, which runs as "nobody", can read
|
113
|
-
#
|
114
|
-
execute :find, fetch(:wp_docroot), '-type d -exec chmod o+rx "{}" \;'
|
115
|
-
execute :find, fetch(:wp_docroot), '-type f -exec chmod o+r "{}" \;'
|
122
|
+
# Use -L flag because we want to follow symlinks. The whole deployment relies on symlinks.
|
123
|
+
execute :find, '-L', File.join(fetch(:wp_docroot), 'wp-content'), '-type d -exec chmod o+rx "{}" \;'
|
124
|
+
execute :find, '-L', File.join(fetch(:wp_docroot), 'wp-content'), '-type f -exec chmod o+r "{}" \;'
|
116
125
|
|
117
126
|
# Invoke searchreplace task to update URL
|
118
127
|
puts "\nYou'll probably want to run the cul:wp:searchreplace command now, since it's likely that your WP URL differs between environments."
|
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
|
+
version: 0.0.10
|
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: 2017-09-
|
12
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|