capistrano-cul 0.1.4 → 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: 6f6e4d22c99c28b5c0ddf0b6bc903cc8bd2f7cf0cd562dcf3e625b639fd03241
4
- data.tar.gz: 28e486f96116d15f3b997f9d740c01cb5cbc5aaf0b5be9f21f60539cff4a07bf
3
+ metadata.gz: '0229d59429d92fb3ad6b6316d2e0cb4b3e35cd5f6541058da2cdce27cff86632'
4
+ data.tar.gz: 00e342d9bbf5ad0953b34630495b0c1f7d8bec69a53749e628c12c0c040f8c6f
5
5
  SHA512:
6
- metadata.gz: 17c5ad2506d77ed90bea2549ddb9396d0a792e4a540bdd60f64e6bbb86d0855254bdc243caf770d07a215f4127fb375cac3a94d23421ec73d4c1b891e8f9ba64
7
- data.tar.gz: edf1aaf1d82b3ff25d8f1cc8fe3de5774c27d8688afb10b28193cd332a4a3a63e42af61dce50648f794d9706a05866ae2f2fb18c15e6a740bf9584da7bc12c31
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.4
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
@@ -170,10 +170,8 @@ namespace :cul do
170
170
 
171
171
  desc "Copies certain wp-content (everything other than plugins, themes, and mu-plugins) from one environment to another (e.g. prod to dev). This task is part of the :copy_from task and isn't meant to be called directly."
172
172
  task :copy_database do
173
-
174
- db_export_tempfile = 'db_export_tempfile.sql'
175
- remote_server_db_export_tempfile_path = Dir::Tmpname.make_tmpname '/tmp/', db_export_tempfile
176
- local_server_db_export_file_path = File.join(fetch(:wp_docroot), db_export_tempfile)
173
+ remote_server_db_export_tempfile_path = Tempfile.create(['db_export_tempfile', '.sql'], '/tmp/').path
174
+ local_server_db_export_file_path = File.join(fetch(:wp_docroot), File.basename(remote_server_db_export_tempfile_path))
177
175
 
178
176
  # Export database from source WordPress instance
179
177
  on fetch(:remote_user) + '@' + fetch(:src_wp_server) do
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-cul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carla Galarza
8
8
  - Eric O'Hanlon
9
9
  - Columbia University Libraries
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-04-24 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
@@ -96,7 +96,7 @@ dependencies:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '1.15'
99
- description:
99
+ description:
100
100
  email:
101
101
  - cmg2228@columbia.edu
102
102
  executables: []
@@ -125,7 +125,7 @@ homepage: https://github.com/cul/capistrano-cul
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -140,8 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.0.8
144
- signing_key:
143
+ rubygems_version: 3.2.32
144
+ signing_key:
145
145
  specification_version: 4
146
146
  summary: Common capistrano tasks shared across projects at CUL
147
147
  test_files: []