capistrano-cul 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29bd16b319da75027598193f5a936771c3c8bd5ac5b46031874b14d8cbb2b44d
4
- data.tar.gz: 522e3368cadebd22ed13a443979003d09a04cee52bdf0cabee06b5a70c8d4f0d
3
+ metadata.gz: '0229d59429d92fb3ad6b6316d2e0cb4b3e35cd5f6541058da2cdce27cff86632'
4
+ data.tar.gz: 00e342d9bbf5ad0953b34630495b0c1f7d8bec69a53749e628c12c0c040f8c6f
5
5
  SHA512:
6
- metadata.gz: '01936834a675f3c5a5dfe414a52678c78e13b6d841e2e0fd5ed853a36ddd0c4299e6152204d2494eefd7371f9d0a29b53b1b067a87485fb8b45b95ba680f4c8e'
7
- data.tar.gz: f367e213d4265aab6414fcc1345a98678d2961e9c05109afff50bac62d26995c74dc27407ce872e17674d1a16a5da98af600bb2d81509cb88b2a1f59ae383ce2
6
+ metadata.gz: 6c2c1a1ad4803773a7aedf38c858cbb5f6c6f0ee1f841ee385ca6b5f64f7674eca3f26279ba367e5ae116ddb9fac7e1edfd30d740d91cd6500616762d558e02a
7
+ data.tar.gz: 72be52d3afe3145f88bd8aba8956fd889e7e5880da618ec4ba7af6ff7fd63d604c8369828d78b8f9c42d2f892937587a3aa34decd522c67bdc5e346499ef6106
data/README.md CHANGED
@@ -120,6 +120,11 @@ set :wp_content_rsync_exclude_filters, [
120
120
  "uploads/2018/01/ignore_this_file.jpg",
121
121
  "uploads/2018/02/also_ignore_this_file.jpg",
122
122
  ]
123
+
124
+ # For this example site, we're symlinking the wp-content/wflogs directory to a corresponding
125
+ # location under /var. We think that WordFence may be locking up occasionally when wflogs
126
+ # is on an NFS mount, and our /var mount is local disk. It seems to help.
127
+ before 'cul:wp:deploy:create_symlinks', 'cul:wp:deploy:symlink_wflogs_to_var_directory'
123
128
  ```
124
129
 
125
130
  ## Development
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -104,6 +104,29 @@ namespace :cul do
104
104
  end
105
105
  end
106
106
 
107
+ desc 'Symlink the wp-content wflogs directory to a corresponding directory in /var'
108
+ task :symlink_wflogs_to_var_directory do
109
+ opt_wflogs_path = File.join(fetch(:wp_docroot), 'wp-content', 'wflogs')
110
+ var_wflogs_path = opt_wflogs_path.sub(/^\/opt/, '/var')
111
+
112
+ on roles(:web) do
113
+ # Create target var wflogs dir if it doesn't exist
114
+ execute :mkdir, '-p', var_wflogs_path
115
+
116
+ # Check if a file or directory already exists at opt wflogs
117
+ if test "[ -e #{opt_wflogs_path} ]"
118
+ if test "[ -L #{opt_wflogs_path} ]"
119
+ # If it's a symlink, delete it and re-create it
120
+ execute :rm, opt_wflogs_path,
121
+ '&&', 'ln', '-s', var_wflogs_path, opt_wflogs_path
122
+ else
123
+ # If it's NOT a symlink, move it and symlink to the var wflogs dir
124
+ execute :mv, opt_wflogs_path, "#{opt_wflogs_path}-#{Time.now.strftime("%Y-%m-%d-%H%M")}",
125
+ '&&', 'ln', '-s', var_wflogs_path, opt_wflogs_path
126
+ end
127
+ end
128
+ end
129
+ end
107
130
  end
108
131
  end
109
132
  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.1.6
4
+ version: 0.1.7
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: 2022-01-21 00:00:00.000000000 Z
13
+ date: 2022-11-29 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.3.5
143
+ rubygems_version: 3.2.32
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Common capistrano tasks shared across projects at CUL