capistrano-wpcli 0.0.5 → 0.0.6
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.
- data/README.md +13 -3
- data/lib/capistrano/tasks/wpuploads.rake +40 -0
- data/lib/capistrano/wpcli/version.rb +1 -1
- metadata +3 -8
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
**Note: this plugin works only with Capistrano 3.**
|
4
4
|
|
5
|
-
|
5
|
+
Provides command line tools to facilitate Wordpress deploy.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -38,10 +38,14 @@ Pulls the remote server WP database to local and replaces the urls.
|
|
38
38
|
Flush rewrite rules.
|
39
39
|
* `wpcli:rewrite:hard_flush`<br/>
|
40
40
|
Perform a hard flush - update `.htaccess` rules as well as rewrite rules in database.
|
41
|
+
* `wpcli:uploads:rsync:push`<br/>
|
42
|
+
Push local uploads delta to remote machine using rsync.
|
43
|
+
* `wpcli:uploads:rsync:pull`<br/>
|
44
|
+
Pull remote uploads delta to local machine using rsync.
|
41
45
|
|
42
46
|
### Configuration
|
43
47
|
|
44
|
-
This plugin needs some configuration to work properly. You can put all your configs in
|
48
|
+
This plugin needs some configuration to work properly. You can put all your configs in Capistrano stage files i.e. `config/deploy/production.rb`.
|
45
49
|
|
46
50
|
Here's the list of options and the defaults for each option:
|
47
51
|
|
@@ -55,7 +59,13 @@ Url of the Wordpress root installation on the local server (used by search-repla
|
|
55
59
|
A local temp dir which is read and writeable. Defaults to `/tmp`.
|
56
60
|
|
57
61
|
* `set :wpcli_args`<br/>
|
58
|
-
You can pass arguments directly to WPCLI using this var. By default it will try to load values from `ENV['WPCLI_ARGS']`.
|
62
|
+
You can pass arguments directly to WPCLI using this var. By default it will try to load values from `ENV['WPCLI_ARGS']`.
|
63
|
+
|
64
|
+
* `set :wpcli_local_uploads_dir`<br/>
|
65
|
+
Local dir where WP stores the uploads. IMPORTANT: Add trailing slash!
|
66
|
+
|
67
|
+
* `set :wpcli_remote_uploads_dir`<br/>
|
68
|
+
Remote dir where WP stores the uploads. IMPORTANT: Add trailing slash!
|
59
69
|
|
60
70
|
## Contributing
|
61
71
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
namespace :load do
|
2
|
+
task :defaults do
|
3
|
+
# These options are passed directly to rsync
|
4
|
+
# Append your options, overwriting the defaults may result in malfunction
|
5
|
+
# Ex: --recursive --delete --exclude .git*
|
6
|
+
set :wpcli_rsync_options, %w[-avz --rsh=ssh]
|
7
|
+
|
8
|
+
# Local dir where WP stores the uploads
|
9
|
+
# IMPORTANT: Add trailing slash!
|
10
|
+
set :wpcli_local_uploads_dir, "wp-content/uploads/"
|
11
|
+
|
12
|
+
# Remote dir where WP stores the uploads
|
13
|
+
# IMPORTANT: Add trailing slash!
|
14
|
+
set :wpcli_remote_uploads_dir, "wp-content/uploads/"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
namespace :wpcli do
|
19
|
+
namespace :uploads do
|
20
|
+
namespace :rsync do
|
21
|
+
desc "Push local uploads delta to remote machine"
|
22
|
+
task :push do
|
23
|
+
roles(:all).each do |role|
|
24
|
+
run_locally do
|
25
|
+
execute :rsync, fetch(:wpcli_rsync_options), fetch(:wpcli_local_uploads_dir), "#{role.user}@#{role.hostname}:#{fetch(:wpcli_remote_uploads_dir)}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Pull remote uploads delta to local machine"
|
31
|
+
task :pull do
|
32
|
+
roles(:all).each do |role|
|
33
|
+
run_locally do
|
34
|
+
execute :rsync, fetch(:wpcli_rsync_options), "#{role.user}@#{role.hostname}:#{fetch(:wpcli_remote_uploads_dir)}", fetch(:wpcli_local_uploads_dir)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-wpcli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/capistrano/tasks/wpcli.rake
|
79
79
|
- lib/capistrano/tasks/wpdb.rake
|
80
80
|
- lib/capistrano/tasks/wprewrite.rake
|
81
|
+
- lib/capistrano/tasks/wpuploads.rake
|
81
82
|
- lib/capistrano/wpcli.rb
|
82
83
|
- lib/capistrano/wpcli/version.rb
|
83
84
|
homepage: https://github.com/lavmeiker/capistrano-wpcli
|
@@ -93,18 +94,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
94
|
- - ! '>='
|
94
95
|
- !ruby/object:Gem::Version
|
95
96
|
version: '0'
|
96
|
-
segments:
|
97
|
-
- 0
|
98
|
-
hash: 3429493196073849224
|
99
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
98
|
none: false
|
101
99
|
requirements:
|
102
100
|
- - ! '>='
|
103
101
|
- !ruby/object:Gem::Version
|
104
102
|
version: '0'
|
105
|
-
segments:
|
106
|
-
- 0
|
107
|
-
hash: 3429493196073849224
|
108
103
|
requirements: []
|
109
104
|
rubyforge_project:
|
110
105
|
rubygems_version: 1.8.23
|