wordmove 1.4.0.pre7 → 1.4.0.pre8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/README.mdown +8 -3
- data/lib/wordmove/cli.rb +16 -2
- data/lib/wordmove/deployer/base.rb +11 -9
- data/lib/wordmove/deployer/ssh.rb +3 -2
- data/lib/wordmove/logger.rb +4 -0
- data/lib/wordmove/version.rb +1 -1
- data/lib/wordmove/wordpress_directory.rb +14 -16
- data/lib/wordmove/wordpress_directory/path.rb +10 -0
- data/wordmove.gemspec +7 -7
- metadata +24 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd5dc97097603a0676f7e74164930fc30bd5075
|
4
|
+
data.tar.gz: 1368b0ffa30ff530fbbda793de9a158c15f211a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bf3456e0f2a4a21eeba58f3a610d513c949772c25fbf57440a57f894dea7237333b550070d654377c3bfdbc242d142be4805c088ade6aece1700f3a9548e886
|
7
|
+
data.tar.gz: d705f83295a45f7a5ae607793894a6043bdc255e39f3aa90d05cf066740d82386db41baafde984838bf290f2e1c3ae9d59bd9483dc1e3dd535d354ad37cfc179
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.0
|
data/.travis.yml
CHANGED
data/README.mdown
CHANGED
@@ -79,6 +79,10 @@ production:
|
|
79
79
|
- "Movefile"
|
80
80
|
- "wp-config.php"
|
81
81
|
- "wp-content/*.sql"
|
82
|
+
|
83
|
+
ssh:
|
84
|
+
host: "host"
|
85
|
+
user: "user"
|
82
86
|
```
|
83
87
|
|
84
88
|
We warmly **recommend** to read the wiki article [Multiple environments explained
|
@@ -139,11 +143,12 @@ Visit [Wordpress Tools](http://wptools.it).
|
|
139
143
|
|
140
144
|
## Contribute
|
141
145
|
|
142
|
-
In order to promote a simpler contribution workflow we have decided to fork the `master` branch
|
143
|
-
`branch`.
|
146
|
+
In order to promote a simpler contribution workflow we have decided to fork and PR the `master` branch.
|
144
147
|
We will accordingly tag and release or pre-release versions to the rubygems.org repository.
|
145
148
|
Do not consider the `dev` branch for your forks and PR.
|
146
|
-
We will never more use version-named branches as in the past
|
149
|
+
We will never more use version-named branches as in the past, but we'll tag release on `master` and pre-release on `dev`.
|
150
|
+
|
151
|
+
### Please, **read the full [contributor guide](https://github.com/welaika/wordmove/wiki/Contributor-Guide)**.
|
147
152
|
|
148
153
|
Feel free to open an issue about contribution if more you need more info
|
149
154
|
|
data/lib/wordmove/cli.rb
CHANGED
@@ -46,6 +46,10 @@ module Wordmove
|
|
46
46
|
puts "No options given. See wordmove --help"
|
47
47
|
exit 1
|
48
48
|
end
|
49
|
+
|
50
|
+
def logger
|
51
|
+
Logger.new(STDOUT).tap { |l| l.level = Logger::DEBUG }
|
52
|
+
end
|
49
53
|
end
|
50
54
|
|
51
55
|
desc "pull", "Pulls WP data from remote host to the local machine"
|
@@ -54,7 +58,12 @@ module Wordmove
|
|
54
58
|
end
|
55
59
|
def pull
|
56
60
|
ensure_wordpress_options_presence!(options)
|
57
|
-
|
61
|
+
begin
|
62
|
+
deployer = Wordmove::Deployer::Base.deployer_for(options)
|
63
|
+
rescue MovefileNotFound => e
|
64
|
+
logger.error(e.message)
|
65
|
+
exit 1
|
66
|
+
end
|
58
67
|
handle_options(options) do |task|
|
59
68
|
deployer.send("pull_#{task}")
|
60
69
|
end
|
@@ -66,7 +75,12 @@ module Wordmove
|
|
66
75
|
end
|
67
76
|
def push
|
68
77
|
ensure_wordpress_options_presence!(options)
|
69
|
-
|
78
|
+
begin
|
79
|
+
deployer = Wordmove::Deployer::Base.deployer_for(options)
|
80
|
+
rescue MovefileNotFound => e
|
81
|
+
logger.error(e.message)
|
82
|
+
exit 1
|
83
|
+
end
|
70
84
|
handle_options(options) do |task|
|
71
85
|
deployer.send("push_#{task}")
|
72
86
|
end
|
@@ -147,12 +147,11 @@ module Wordmove
|
|
147
147
|
end
|
148
148
|
|
149
149
|
[
|
150
|
-
WordpressDirectory::
|
151
|
-
WordpressDirectory::
|
152
|
-
WordpressDirectory::
|
153
|
-
WordpressDirectory::
|
154
|
-
WordpressDirectory::
|
155
|
-
WordpressDirectory::PATH::LANGUAGES
|
150
|
+
WordpressDirectory::Path::WP_CONTENT,
|
151
|
+
WordpressDirectory::Path::PLUGINS,
|
152
|
+
WordpressDirectory::Path::THEMES,
|
153
|
+
WordpressDirectory::Path::UPLOADS,
|
154
|
+
WordpressDirectory::Path::LANGUAGES
|
156
155
|
].each do |type|
|
157
156
|
[:remote, :local].each do |location|
|
158
157
|
define_method "#{location}_#{type}_dir" do
|
@@ -180,7 +179,7 @@ module Wordmove
|
|
180
179
|
if options[:charset].present?
|
181
180
|
command << "--default-character-set=#{Shellwords.escape(options[:charset])}"
|
182
181
|
end
|
183
|
-
command << "--result-file
|
182
|
+
command << "--result-file=\"#{save_to_path}\""
|
184
183
|
if options[:mysqldump_options].present?
|
185
184
|
command << Shellwords.split(options[:mysqldump_options])
|
186
185
|
end
|
@@ -201,7 +200,7 @@ module Wordmove
|
|
201
200
|
command << "--default-character-set=#{Shellwords.escape(options[:charset])}"
|
202
201
|
end
|
203
202
|
command << "--database=#{Shellwords.escape(options[:name])}"
|
204
|
-
command << "--execute
|
203
|
+
command << "--execute=\"SET autocommit=0;SOURCE #{dump_path};COMMIT\""
|
205
204
|
puts command.join(" ")
|
206
205
|
command.join(" ")
|
207
206
|
end
|
@@ -209,13 +208,16 @@ module Wordmove
|
|
209
208
|
def compress_command(path)
|
210
209
|
command = ["gzip"]
|
211
210
|
command << "--best"
|
211
|
+
command << "--force"
|
212
212
|
command << Shellwords.escape(path)
|
213
213
|
puts command.join(" ")
|
214
214
|
command.join(" ")
|
215
215
|
end
|
216
216
|
|
217
217
|
def uncompress_command(path)
|
218
|
-
command = ["
|
218
|
+
command = ["gzip"]
|
219
|
+
command << "-d"
|
220
|
+
command << "--force"
|
219
221
|
command << Shellwords.escape(path)
|
220
222
|
puts command.join(" ")
|
221
223
|
command.join(" ")
|
@@ -12,9 +12,10 @@ module Wordmove
|
|
12
12
|
|
13
13
|
local_dump_path = local_wp_content_dir.path("dump.sql")
|
14
14
|
local_gzipped_dump_path = local_dump_path + '.gz'
|
15
|
-
|
15
|
+
local_gzipped_backup_path = local_wp_content_dir
|
16
|
+
.path("#{environment}-backup-#{Time.now.to_i}.sql.gz")
|
16
17
|
|
17
|
-
download_remote_db(
|
18
|
+
download_remote_db(local_gzipped_backup_path)
|
18
19
|
|
19
20
|
save_local_db(local_dump_path)
|
20
21
|
adapt_sql(local_dump_path, local_options, remote_options)
|
data/lib/wordmove/logger.rb
CHANGED
data/lib/wordmove/version.rb
CHANGED
@@ -1,22 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
LANGUAGES = :languages
|
1
|
+
require 'wordmove/wordpress_directory/path'
|
2
|
+
|
3
|
+
class WordpressDirectory
|
4
|
+
attr_accessor :type, :options
|
5
|
+
|
6
|
+
def initialize(type, options)
|
7
|
+
@type = type
|
8
|
+
@options = options
|
10
9
|
end
|
11
10
|
|
12
11
|
DEFAULT_PATHS = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
PATH::LANGUAGES => 'wp-content/languages'
|
12
|
+
Path::WP_CONTENT => 'wp-content',
|
13
|
+
Path::WP_CONFIG => 'wp-config.php',
|
14
|
+
Path::PLUGINS => 'wp-content/plugins',
|
15
|
+
Path::THEMES => 'wp-content/themes',
|
16
|
+
Path::UPLOADS => 'wp-content/uploads',
|
17
|
+
Path::LANGUAGES => 'wp-content/languages'
|
20
18
|
}.freeze
|
21
19
|
|
22
20
|
def self.default_path_for(sym)
|
data/wordmove.gemspec
CHANGED
@@ -27,14 +27,14 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.
|
33
|
-
spec.
|
30
|
+
spec.add_runtime_dependency "colorize", "~> 0.7.5"
|
31
|
+
spec.add_runtime_dependency "thor", "~> 0.19.1"
|
32
|
+
spec.add_runtime_dependency "activesupport", "~> 4.2", ">= 4.2.1"
|
33
|
+
spec.add_runtime_dependency "photocopier", "~> 1.1", ">= 1.1.0"
|
34
34
|
|
35
35
|
spec.required_ruby_version = "~> 2.0"
|
36
36
|
|
37
|
-
spec.add_development_dependency "bundler", ">= 1.6.2"
|
37
|
+
spec.add_development_dependency "bundler", "~> 1.6", ">= 1.6.2"
|
38
38
|
spec.add_development_dependency "rake", "~> 10.0"
|
39
39
|
spec.add_development_dependency "rspec", "~> 3.3"
|
40
40
|
spec.add_development_dependency "simplecov", "~> 0.9"
|
@@ -45,8 +45,8 @@ Gem::Specification.new do |spec|
|
|
45
45
|
|
46
46
|
spec.post_install_message = <<-RAINBOW
|
47
47
|
Starting from 1.4.0 Wordmove will compress SQL dumps both in remote and locale environments.
|
48
|
-
If something will broke, please check if gzip
|
49
|
-
remotely. We are considering
|
48
|
+
If something will broke, please check if gzip executable is present locally and
|
49
|
+
remotely. We are considering obvious it's installed in any web environment.
|
50
50
|
Open an issue on github at your needs.
|
51
51
|
RAINBOW
|
52
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordmove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0.
|
4
|
+
version: 1.4.0.pre8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-02-
|
14
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: colorize
|
@@ -46,6 +46,9 @@ dependencies:
|
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '4.2'
|
51
|
+
- - ">="
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: 4.2.1
|
51
54
|
type: :runtime
|
@@ -53,6 +56,9 @@ dependencies:
|
|
53
56
|
version_requirements: !ruby/object:Gem::Requirement
|
54
57
|
requirements:
|
55
58
|
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.2'
|
61
|
+
- - ">="
|
56
62
|
- !ruby/object:Gem::Version
|
57
63
|
version: 4.2.1
|
58
64
|
- !ruby/object:Gem::Dependency
|
@@ -60,6 +66,9 @@ dependencies:
|
|
60
66
|
requirement: !ruby/object:Gem::Requirement
|
61
67
|
requirements:
|
62
68
|
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '1.1'
|
71
|
+
- - ">="
|
63
72
|
- !ruby/object:Gem::Version
|
64
73
|
version: 1.1.0
|
65
74
|
type: :runtime
|
@@ -67,12 +76,18 @@ dependencies:
|
|
67
76
|
version_requirements: !ruby/object:Gem::Requirement
|
68
77
|
requirements:
|
69
78
|
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.1'
|
81
|
+
- - ">="
|
70
82
|
- !ruby/object:Gem::Version
|
71
83
|
version: 1.1.0
|
72
84
|
- !ruby/object:Gem::Dependency
|
73
85
|
name: bundler
|
74
86
|
requirement: !ruby/object:Gem::Requirement
|
75
87
|
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '1.6'
|
76
91
|
- - ">="
|
77
92
|
- !ruby/object:Gem::Version
|
78
93
|
version: 1.6.2
|
@@ -80,6 +95,9 @@ dependencies:
|
|
80
95
|
prerelease: false
|
81
96
|
version_requirements: !ruby/object:Gem::Requirement
|
82
97
|
requirements:
|
98
|
+
- - "~>"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '1.6'
|
83
101
|
- - ">="
|
84
102
|
- !ruby/object:Gem::Version
|
85
103
|
version: 1.6.2
|
@@ -223,6 +241,7 @@ files:
|
|
223
241
|
- lib/wordmove/sql_adapter.rb
|
224
242
|
- lib/wordmove/version.rb
|
225
243
|
- lib/wordmove/wordpress_directory.rb
|
244
|
+
- lib/wordmove/wordpress_directory/path.rb
|
226
245
|
- pkg/wordmove-0.0.1.gem
|
227
246
|
- pkg/wordmove-0.0.2.gem
|
228
247
|
- wordmove.gemspec
|
@@ -232,8 +251,8 @@ licenses:
|
|
232
251
|
metadata: {}
|
233
252
|
post_install_message: |2
|
234
253
|
Starting from 1.4.0 Wordmove will compress SQL dumps both in remote and locale environments.
|
235
|
-
If something will broke, please check if gzip
|
236
|
-
remotely. We are considering
|
254
|
+
If something will broke, please check if gzip executable is present locally and
|
255
|
+
remotely. We are considering obvious it's installed in any web environment.
|
237
256
|
Open an issue on github at your needs.
|
238
257
|
rdoc_options: []
|
239
258
|
require_paths:
|
@@ -250,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
269
|
version: 1.3.1
|
251
270
|
requirements: []
|
252
271
|
rubyforge_project:
|
253
|
-
rubygems_version: 2.
|
272
|
+
rubygems_version: 2.5.1
|
254
273
|
signing_key:
|
255
274
|
specification_version: 4
|
256
275
|
summary: Wordmove, Capistrano for Wordpress
|