capistrano-cul 0.1.7 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/VERSION +1 -1
- data/lib/capistrano/tasks/wp/deploy.cap +12 -12
- data/lib/capistrano/tasks/wp/migrate.cap +14 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e45a37c83d7409c27a9363783d566178c6c9de89b308ac06fcb75fc062a3d679
|
4
|
+
data.tar.gz: ed9b25f8a4faf0753ff16f5a8bc3c7447e298559165fef4abb176432b5968fb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0568d92354d3b8fdf8583ba3b579803813ef27158f4fa6fbf32180f6eff1945c10a60e3f5586785d432daf03be96fad388c63d3c16673ddba86a6688a7daf062'
|
7
|
+
data.tar.gz: 1d19fe901a4a1307e08a383f062fafae414a9fbebd17d03bb8fb6485913f947f1ec82c9bccc8a360e2832975b5bccce59bca8e493a3f68036c17162970ab06c9
|
data/README.md
CHANGED
@@ -109,9 +109,11 @@ set :wp_custom_plugins, {
|
|
109
109
|
'custom-plugin-directory' => 'plugins/custom-plugin-directory'
|
110
110
|
}
|
111
111
|
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
# NOTE: It is important that the keys in the hash below match the plugin name
|
113
|
+
# keys exactly. The zip file url can be any valid, publicly-accessible url.
|
114
|
+
set :additional_plugins_from_remote_zip, {
|
115
|
+
'cf-byline' => 'https://github.com/cul/cf-byline/archive/v1.0.0.zip'
|
116
|
+
}
|
115
117
|
|
116
118
|
set :wp_custom_themes, {
|
117
119
|
'mytheme' => 'themes/mytheme'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -44,10 +44,10 @@ namespace :cul do
|
|
44
44
|
task :install_additional_plugins_from_remote_zip do
|
45
45
|
on roles(:web) do
|
46
46
|
within File.join(fetch(:wp_docroot)) do
|
47
|
-
|
47
|
+
plugin_zip_names_and_urls = fetch(:additional_plugins_from_remote_zip) || {}
|
48
48
|
# Make sure that all of the URLs start with http:// or https://
|
49
|
-
raise 'Found non-http/https url in :additional_plugins_from_remote_zip' if
|
50
|
-
|
49
|
+
raise 'Found non-http/https url in :additional_plugins_from_remote_zip' if plugin_zip_names_and_urls.values.detect { |val| val !~ /^https?:\/\// }
|
50
|
+
plugin_zip_names_and_urls.each do |plugin_name, plugin_url|
|
51
51
|
execute :wp, (fetch(:multisite, false) ? "--url=#{fetch(:dest_multisite_domain)}" : ''), 'plugin', 'install', plugin_url, '--force'
|
52
52
|
end
|
53
53
|
end
|
@@ -106,23 +106,23 @@ namespace :cul do
|
|
106
106
|
|
107
107
|
desc 'Symlink the wp-content wflogs directory to a corresponding directory in /var'
|
108
108
|
task :symlink_wflogs_to_var_directory do
|
109
|
-
|
110
|
-
|
109
|
+
wp_docroot_wflogs_path = File.join(fetch(:wp_docroot), 'wp-content', 'wflogs')
|
110
|
+
local_disk_wflogs_path = File.join(fetch(:local_disk_wflogs_path), wp_docroot_wflogs_path.sub(/^\/opt/, '/var'))
|
111
111
|
|
112
112
|
on roles(:web) do
|
113
113
|
# Create target var wflogs dir if it doesn't exist
|
114
|
-
execute :mkdir, '-p',
|
114
|
+
execute :mkdir, '-p', local_disk_wflogs_path
|
115
115
|
|
116
116
|
# Check if a file or directory already exists at opt wflogs
|
117
|
-
if test "[ -e #{
|
118
|
-
if test "[ -L #{
|
117
|
+
if test "[ -e #{wp_docroot_wflogs_path} ]"
|
118
|
+
if test "[ -L #{wp_docroot_wflogs_path} ]"
|
119
119
|
# If it's a symlink, delete it and re-create it
|
120
|
-
execute :rm,
|
121
|
-
'&&', 'ln', '-s',
|
120
|
+
execute :rm, wp_docroot_wflogs_path,
|
121
|
+
'&&', 'ln', '-s', local_disk_wflogs_path, wp_docroot_wflogs_path
|
122
122
|
else
|
123
123
|
# If it's NOT a symlink, move it and symlink to the var wflogs dir
|
124
|
-
execute :mv,
|
125
|
-
'&&', 'ln', '-s',
|
124
|
+
execute :mv, wp_docroot_wflogs_path, "#{wp_docroot_wflogs_path}-#{Time.now.strftime("%Y-%m-%d-%H%M")}",
|
125
|
+
'&&', 'ln', '-s', local_disk_wflogs_path, wp_docroot_wflogs_path
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
@@ -104,7 +104,10 @@ namespace :cul do
|
|
104
104
|
'--exclude="mu-plugins"',
|
105
105
|
'--exclude="themes"',
|
106
106
|
'--exclude="uploads"',
|
107
|
-
'--exclude="blogs.dir"'
|
107
|
+
'--exclude="blogs.dir"',
|
108
|
+
# We don't want to copy wflogs because we will be symlinking the
|
109
|
+
# dir on the other side, and Wordfence will recreate it anyway.
|
110
|
+
'--exclude="wflogs"'
|
108
111
|
] +
|
109
112
|
# Apply user-defined exclusion filters, if present
|
110
113
|
fetch(:wp_content_rsync_exclude_filters, []).map{ |filter_value| "--exclude=\"#{filter_value}\"" } +
|
@@ -149,8 +152,8 @@ namespace :cul do
|
|
149
152
|
on roles(:web) do
|
150
153
|
within dest_wp_content_path do
|
151
154
|
files_not_copied = capture(:comm, '-23',
|
152
|
-
"<(ssh #{fetch(:remote_user)}@#{fetch(:src_wp_server)} \"cd #{src_wp_content_path} && find . -type f \\( -path '*/uploads/*' -o -path '*/blogs.dir/*' \\) | sort\")",
|
153
|
-
"<(cd #{dest_wp_content_path} && find . -type f \\( -path '*/uploads/*' -o -path '*/blogs.dir/*' \\) | sort)"
|
155
|
+
"<(ssh #{fetch(:remote_user)}@#{fetch(:src_wp_server)} \"cd #{src_wp_content_path} && find . -type f \\( -path '*/uploads/*' -o -path '*/blogs.dir/*' \\) | LC_ALL=C sort\")",
|
156
|
+
"<(cd #{dest_wp_content_path} && find . -type f \\( -path '*/uploads/*' -o -path '*/blogs.dir/*' \\) | LC_ALL=C sort)"
|
154
157
|
)
|
155
158
|
|
156
159
|
# Generate list of files that weren't copied. Display this list to the user.
|
@@ -258,7 +261,14 @@ namespace :cul do
|
|
258
261
|
|
259
262
|
puts "Downloading new copies of non-repo-managed plugins and themes..."
|
260
263
|
|
261
|
-
|
264
|
+
remote_zip_plugin_names = (fetch(:additional_plugins_from_remote_zip) || {}).keys
|
265
|
+
|
266
|
+
# Skip plugins that are repo-managed
|
267
|
+
data_for_plugins.delete_if{|plugin_info| repo_managed_plugin_names.include?(plugin_info['name']) }
|
268
|
+
# Skip plugins that come from a remote zip url
|
269
|
+
data_for_plugins.delete_if{|plugin_info| remote_zip_plugin_names.include?(plugin_info['name']) }
|
270
|
+
|
271
|
+
data_for_plugins.each do |plugin_info|
|
262
272
|
name = plugin_info['name']
|
263
273
|
version = plugin_info['version']
|
264
274
|
status = plugin_info['status']
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carla Galarza
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-10-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capistrano
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.4.10
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Common capistrano tasks shared across projects at CUL
|