capistrano-wpcli 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-wpcli (0.0.2)
4
+ capistrano-wpcli (0.0.3)
5
5
  capistrano (>= 3.0)
6
- dotenv
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -13,9 +12,6 @@ GEM
13
12
  rake (>= 10.0.0)
14
13
  sshkit (~> 1.3)
15
14
  colorize (0.7.3)
16
- dotenv (0.11.1)
17
- dotenv-deployment (~> 0.0.2)
18
- dotenv-deployment (0.0.2)
19
15
  i18n (0.6.9)
20
16
  net-scp (1.2.1)
21
17
  net-ssh (>= 2.6.5)
data/README.md CHANGED
@@ -37,28 +37,16 @@ Pulls the remote server WP database to local and replaces the urls.
37
37
 
38
38
  ### Configuration
39
39
 
40
- This plugin needs some configuration to work properly. It will try to load these configurations from the env vars. To do so all you need to do is put the following in `.env` file:
41
-
42
- WP_APP_NAME=example
43
- WP_HOME=http://example.dev
44
- WP_REMOTE_URL=http://example.com
45
-
46
- Alternatively, you can put all your configs in capistrano stage files i.e. `config/deploy/production.rb`.
40
+ This plugin needs some configuration to work properly. You can put all your configs in capistrano stage files i.e. `config/deploy/production.rb`.
47
41
 
48
42
  Here's the list of options and the defaults for each option:
49
43
 
50
- * `set :application`<br/>
51
- Name of the application.
52
-
53
- * `set :remote_url`<br/>
44
+ * `set :wpcli_remote_url`<br/>
54
45
  Url of the Wordpress root installation on the remote server (used by search-replace command).
55
46
 
56
- * `set :local_url`<br/>
47
+ * `set :wpcli_local_url`<br/>
57
48
  Url of the Wordpress root installation on the local server (used by search-replace command).
58
49
 
59
- * `set :remote_tmp_dir`<br/>
60
- A temp dir on the remote server which is read and writeable by the capistrano deploy user. Defaults to `/tmp`.
61
-
62
50
  * `set :local_tmp_dir`<br/>
63
51
  A local temp dir which is read and writeable. Defaults to `/tmp`.
64
52
 
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency 'capistrano', '>= 3.0'
22
- spec.add_dependency 'dotenv'
23
22
 
24
23
  spec.add_development_dependency "bundler", "~> 1.6"
25
24
  spec.add_development_dependency "rake"
@@ -1,24 +1,19 @@
1
1
  namespace :load do
2
2
  task :defaults do
3
- set :application, ENV["WP_APP_NAME"]
4
- # A temp dir which is read and writeable by the capistrano
5
- # deploy user
6
- set :remote_tmp_dir, ENV["WP_REMOTE_TMP"] || "/tmp"
7
-
8
- # A local temp dir which is read and writeable
9
- set :local_tmp_dir, ENV["WP_LOCAL_TMP"] || "/tmp"
10
-
11
3
  # The url under which the wordpress installation is
12
4
  # available on the remote server
13
- set :remote_url, ENV["WP_REMOTE_URL"]
5
+ set :wpcli_remote_url, "http://example.com"
14
6
 
15
7
  # The url under which the wordpress installation is
16
8
  # available on the local server
17
- set :local_url, ENV["WP_HOME"]
9
+ set :wpcli_local_url, "http://example.dev"
10
+
11
+ # A local temp dir which is read and writeable
12
+ set :local_tmp_dir, "/tmp"
18
13
 
19
- # Shortcuts
20
- set :remote_db_file, "#{fetch(:remote_tmp_dir)}/#{fetch(:application)}_database.sql"
21
- set :local_db_file, "#{fetch(:local_tmp_dir)}/#{fetch(:application)}_database.sql"
14
+ # Temporal db dumps path
15
+ set :wpcli_remote_db_file, "#{fetch(:tmp_dir)}/wpcli_database.sql"
16
+ set :wpcli_local_db_file, "#{fetch(:local_tmp_dir)}/wpcli_database.sql"
22
17
  end
23
18
  end
24
19
 
@@ -28,17 +23,15 @@ namespace :wpcli do
28
23
  task :pull do
29
24
  on roles(:web) do
30
25
  within release_path do
31
- with path: "#{fetch(:path)}:$PATH" do
32
- execute :wp, "db export", fetch(:remote_db_file)
33
- download! fetch(:remote_db_file), fetch(:local_db_file)
34
- execute :rm, fetch(:remote_db_file)
35
- end
26
+ execute :wp, "db export", fetch(:wpcli_remote_db_file)
27
+ download! fetch(:wpcli_remote_db_file), fetch(:wpcli_local_db_file)
28
+ execute :rm, fetch(:wpcli_remote_db_file)
36
29
  end
37
30
 
38
31
  run_locally do
39
- execute :wp, "db import", fetch(:local_db_file)
40
- execute :rm, "#{fetch(:local_db_file)}"
41
- execute :wp, "search-replace", "'#{fetch(:remote_url)}' '#{fetch(:local_url)}' --skip-columns=guid"
32
+ execute :wp, "db import", fetch(:wpcli_local_db_file)
33
+ execute :rm, "#{fetch(:wpcli_local_db_file)}"
34
+ execute :wp, "search-replace", fetch(:wpcli_remote_url), fetch(:wpcli_local_url), "--skip-columns=guid"
42
35
  end
43
36
  end
44
37
  end
@@ -47,21 +40,19 @@ namespace :wpcli do
47
40
  task :push do
48
41
  on roles(:web) do
49
42
  run_locally do
50
- execute :wp, "db export", fetch(:local_db_file)
43
+ execute :wp, "db export", fetch(:wpcli_local_db_file)
51
44
  end
52
45
 
53
- upload! fetch(:local_db_file), fetch(:remote_db_file)
46
+ upload! fetch(:wpcli_local_db_file), fetch(:wpcli_remote_db_file)
54
47
 
55
48
  run_locally do
56
- execute :rm, fetch(:local_db_file)
49
+ execute :rm, fetch(:wpcli_local_db_file)
57
50
  end
58
51
 
59
52
  within release_path do
60
- with path: "#{fetch(:path)}:$PATH" do
61
- execute :wp, "db import", fetch(:remote_db_file)
62
- execute :rm, fetch(:remote_db_file)
63
- execute :wp, "search-replace", "'#{fetch(:local_url)}' '#{fetch(:remote_url)}' --skip-columns=guid"
64
- end
53
+ execute :wp, "db import", fetch(:wpcli_remote_db_file)
54
+ execute :rm, fetch(:wpcli_remote_db_file)
55
+ execute :wp, "search-replace", fetch(:wpcli_local_url), fetch(:wpcli_remote_url), "--skip-columns=guid"
65
56
  end
66
57
  end
67
58
  end
@@ -1,6 +1,2 @@
1
- # Load configuration from .env
2
- require "dotenv"
3
- Dotenv.load
4
-
5
1
  load File.expand_path("../tasks/wpcli.rake", __FILE__)
6
2
  load File.expand_path("../tasks/wpdb.rake", __FILE__)
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Wpcli
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  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.2
4
+ version: 0.0.3
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-06-04 00:00:00.000000000 Z
12
+ date: 2014-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -27,22 +27,6 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
- - !ruby/object:Gem::Dependency
31
- name: dotenv
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
30
  - !ruby/object:Gem::Dependency
47
31
  name: bundler
48
32
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
94
  version: '0'
111
95
  segments:
112
96
  - 0
113
- hash: 3608175918401034373
97
+ hash: 3163576760790071014
114
98
  required_rubygems_version: !ruby/object:Gem::Requirement
115
99
  none: false
116
100
  requirements:
@@ -119,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
103
  version: '0'
120
104
  segments:
121
105
  - 0
122
- hash: 3608175918401034373
106
+ hash: 3163576760790071014
123
107
  requirements: []
124
108
  rubyforge_project:
125
109
  rubygems_version: 1.8.23