wordmove 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.mdown +35 -34
- data/lib/wordmove/assets/wordmove_schema_local.yml +1 -3
- data/lib/wordmove/assets/wordmove_schema_remote.yml +2 -12
- data/lib/wordmove/doctor/movefile.rb +12 -2
- data/lib/wordmove/doctor/mysql.rb +7 -1
- data/lib/wordmove/doctor/wpcli.rb +11 -1
- data/lib/wordmove/generators/movefile.yml +45 -45
- data/lib/wordmove/logger.rb +5 -5
- data/lib/wordmove/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b44325c0d09d56d3a59080721d52ef65d301116
|
4
|
+
data.tar.gz: 5fbb645e7df0d2ec0b66773c0c52c5523ec25131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8112d61e266fb7b83227463dcd70e6160a006bbfa19cbf1405502783a7a0ddcb4ee8b4d8a28df9ee2d88cd9f93c7bdc962926e2da1296444fb7dff83b770f464
|
7
|
+
data.tar.gz: 0f07783014805087b720a9b11b48fc7fda2a79e3b6ab0f8eca31ad75ac3d82f7b6d07c9434f393ab94b4b8924c16bfc38e324e3e550625afa09f24981a4bcec6
|
data/README.mdown
CHANGED
@@ -12,6 +12,7 @@ Think of it like Capistrano for Wordpress, complete with push/pull capabilities.
|
|
12
12
|
|
13
13
|
[![Build Status](https://travis-ci.org/welaika/wordmove.png?branch=master)](https://travis-ci.org/welaika/wordmove)
|
14
14
|
[![Slack channel](https://img.shields.io/badge/Slack-WP--Hub-blue.svg)](https://wphub-auto-invitation.herokuapp.com/)
|
15
|
+
[![Gem Version](https://badge.fury.io/rb/wordmove.svg)](https://rubygems.org/gems/wordmove)
|
15
16
|
|
16
17
|
## Installation
|
17
18
|
|
@@ -64,54 +65,54 @@ You can configure Wordmove creating a `movefile.yml`. That's just a YAML file wi
|
|
64
65
|
|
65
66
|
```yaml
|
66
67
|
global:
|
67
|
-
sql_adapter:
|
68
|
+
sql_adapter: default
|
68
69
|
|
69
70
|
local:
|
70
|
-
vhost:
|
71
|
-
wordpress_path:
|
71
|
+
vhost: http://vhost.local
|
72
|
+
wordpress_path: /home/john/sites/your_site # use an absolute path here
|
72
73
|
|
73
74
|
database:
|
74
|
-
name:
|
75
|
-
user:
|
76
|
-
password:
|
77
|
-
host:
|
75
|
+
name: database_name
|
76
|
+
user: user
|
77
|
+
password: password
|
78
|
+
host: localhost
|
78
79
|
|
79
80
|
# paths: # you can customize wordpress internal paths
|
80
|
-
# wp_content:
|
81
|
-
# uploads:
|
82
|
-
# plugins:
|
83
|
-
# themes:
|
84
|
-
# languages:
|
81
|
+
# wp_content: wp-content
|
82
|
+
# uploads: wp-content/uploads
|
83
|
+
# plugins: wp-content/plugins
|
84
|
+
# themes: wp-content/themes
|
85
|
+
# languages: wp-content/languages
|
85
86
|
|
86
87
|
production:
|
87
|
-
vhost:
|
88
|
-
wordpress_path:
|
88
|
+
vhost: http://example.com
|
89
|
+
wordpress_path: /var/www/your_site # use an absolute path here
|
89
90
|
|
90
91
|
database:
|
91
|
-
name:
|
92
|
-
user:
|
93
|
-
password:
|
94
|
-
host:
|
95
|
-
# port:
|
96
|
-
# mysqldump_options:
|
92
|
+
name: database_name
|
93
|
+
user: user
|
94
|
+
password: password
|
95
|
+
host: host
|
96
|
+
# port: 3308 # Use just in case you have exotic server config
|
97
|
+
# mysqldump_options: --max_allowed_packet=50MB # Only available if using SSH
|
97
98
|
|
98
99
|
exclude:
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
100
|
+
- .git/
|
101
|
+
- .gitignore
|
102
|
+
- .sass-cache/
|
103
|
+
- bin/
|
104
|
+
- tmp/*
|
105
|
+
- Gemfile*
|
106
|
+
- Movefile
|
107
|
+
- movefile
|
108
|
+
- movefile.yml
|
109
|
+
- movefile.yaml
|
110
|
+
- wp-config.php
|
111
|
+
- wp-content/*.sql
|
111
112
|
|
112
113
|
ssh:
|
113
|
-
host:
|
114
|
-
user:
|
114
|
+
host: host
|
115
|
+
user: user
|
115
116
|
```
|
116
117
|
|
117
118
|
**We warmly recommend to read the wiki article [Multiple environments explained
|
@@ -5,6 +5,7 @@ mapping:
|
|
5
5
|
wordpress_path:
|
6
6
|
database:
|
7
7
|
type: map
|
8
|
+
required: true
|
8
9
|
mapping:
|
9
10
|
name:
|
10
11
|
required: true
|
@@ -15,8 +16,5 @@ mapping:
|
|
15
16
|
host:
|
16
17
|
required: true
|
17
18
|
mysqldump_options:
|
18
|
-
required: false
|
19
19
|
port:
|
20
|
-
required: false
|
21
20
|
charset:
|
22
|
-
required: false
|
@@ -2,14 +2,13 @@ type: map
|
|
2
2
|
mapping:
|
3
3
|
vhost:
|
4
4
|
type: str
|
5
|
-
pattern: /^
|
5
|
+
pattern: /^https?:\/\//
|
6
6
|
required: true
|
7
7
|
wordpress_path:
|
8
8
|
type: str
|
9
9
|
required: true
|
10
10
|
wordpress_absolute_path:
|
11
11
|
type: str
|
12
|
-
required: false
|
13
12
|
database:
|
14
13
|
type: map
|
15
14
|
required: true
|
@@ -28,21 +27,16 @@ mapping:
|
|
28
27
|
required: true
|
29
28
|
mysqldump_options:
|
30
29
|
type: str
|
31
|
-
required: false
|
32
30
|
port:
|
33
|
-
type:
|
34
|
-
required: false
|
31
|
+
type: int
|
35
32
|
charset:
|
36
33
|
type: str
|
37
|
-
required: false
|
38
34
|
exclude:
|
39
35
|
type: seq
|
40
|
-
required: false
|
41
36
|
sequence:
|
42
37
|
- type: str
|
43
38
|
paths:
|
44
39
|
type: map
|
45
|
-
required: false
|
46
40
|
mapping:
|
47
41
|
wp_content:
|
48
42
|
wp_config:
|
@@ -53,20 +47,17 @@ mapping:
|
|
53
47
|
languages:
|
54
48
|
ssh:
|
55
49
|
type: map
|
56
|
-
required: false
|
57
50
|
mapping:
|
58
51
|
host:
|
59
52
|
required: true
|
60
53
|
user:
|
61
54
|
required: false # If host is configured in ~/.ssh/config
|
62
55
|
password:
|
63
|
-
required: false
|
64
56
|
port:
|
65
57
|
type: int
|
66
58
|
rsync_options:
|
67
59
|
gateway:
|
68
60
|
type: map
|
69
|
-
required: false
|
70
61
|
mapping:
|
71
62
|
host:
|
72
63
|
required: true
|
@@ -75,7 +66,6 @@ mapping:
|
|
75
66
|
password:
|
76
67
|
ftp:
|
77
68
|
type: map
|
78
|
-
required: false
|
79
69
|
mapping:
|
80
70
|
user:
|
81
71
|
required: true
|
@@ -6,11 +6,21 @@ module Wordmove
|
|
6
6
|
|
7
7
|
def initialize(name = nil, dir = '.')
|
8
8
|
@movefile = Wordmove::Movefile.new
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
begin
|
11
|
+
@contents = movefile.fetch(name, dir)
|
12
|
+
@root_keys = contents.keys
|
13
|
+
rescue Psych::SyntaxError
|
14
|
+
movefile.logger.error "Your movefile is not parsable due to a syntax error"\
|
15
|
+
"so we can't continue to validate it."
|
16
|
+
movefile.logger.debug "You could try to use https://yamlvalidator.com/ to"\
|
17
|
+
"get a clue about the problem."
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
21
|
def validate!
|
22
|
+
return false unless root_keys
|
23
|
+
|
14
24
|
MANDATORY_SECTIONS.each do |key|
|
15
25
|
movefile.logger.task "Validating movefile section: #{key}"
|
16
26
|
validate_mandatory_section(key)
|
@@ -4,13 +4,19 @@ module Wordmove
|
|
4
4
|
attr_reader :config, :logger
|
5
5
|
|
6
6
|
def initialize(movefile_name = nil, movefile_dir = '.')
|
7
|
-
@config = Wordmove::Movefile.new.fetch(movefile_name, movefile_dir)["local"]["database"]
|
8
7
|
@logger = Logger.new(STDOUT).tap { |l| l.level = Logger::INFO }
|
8
|
+
begin
|
9
|
+
@config = Wordmove::Movefile.new.fetch(movefile_name, movefile_dir)["local"]["database"]
|
10
|
+
rescue Psych::SyntaxError
|
11
|
+
return
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
def check!
|
12
16
|
logger.task "Checking local database commands and connection"
|
13
17
|
|
18
|
+
return logger.error "Can't connect to mysql using your movefile.yml" if config.nil?
|
19
|
+
|
14
20
|
mysql_client_doctor
|
15
21
|
mysqldump_doctor
|
16
22
|
mysql_server_doctor
|
@@ -10,12 +10,22 @@ module Wordmove
|
|
10
10
|
def check!
|
11
11
|
logger.task "Checking local wp-cli installation"
|
12
12
|
|
13
|
-
if
|
13
|
+
if in_path? && up_to_date?
|
14
14
|
logger.success "wp-cli is correctly installed and up to date"
|
15
15
|
else
|
16
16
|
logger.error "wp-cli is not installed (or not in your $PATH) or not up to date"
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def in_path?
|
23
|
+
system('which wp', out: File::NULL)
|
24
|
+
end
|
25
|
+
|
26
|
+
def up_to_date?
|
27
|
+
`wp cli check-update --format=json`.empty?
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
@@ -1,68 +1,68 @@
|
|
1
1
|
global:
|
2
|
-
sql_adapter:
|
2
|
+
sql_adapter: default
|
3
3
|
|
4
4
|
local:
|
5
|
-
vhost:
|
6
|
-
wordpress_path:
|
5
|
+
vhost: http://vhost.local
|
6
|
+
wordpress_path: <%= wordpress_path %> # use an absolute path here
|
7
7
|
|
8
8
|
database:
|
9
|
-
name:
|
10
|
-
user:
|
11
|
-
password: "<%= database.password %>"
|
12
|
-
host:
|
9
|
+
name: <%= database.name %>
|
10
|
+
user: <%= database.user %>
|
11
|
+
password: "<%= database.password %>" # could be blank, so always use quotes around
|
12
|
+
host: <%= database.host %>
|
13
13
|
|
14
14
|
production:
|
15
|
-
vhost:
|
16
|
-
wordpress_path:
|
15
|
+
vhost: http://example.com
|
16
|
+
wordpress_path: /var/www/your_site # use an absolute path here
|
17
17
|
|
18
18
|
database:
|
19
|
-
name:
|
20
|
-
user:
|
21
|
-
password:
|
22
|
-
host:
|
23
|
-
# port:
|
24
|
-
# mysqldump_options:
|
19
|
+
name: database_name
|
20
|
+
user: user
|
21
|
+
password: password
|
22
|
+
host: host
|
23
|
+
# port: 3308 # Use just in case you have exotic server config
|
24
|
+
# mysqldump_options: --max_allowed_packet=1G # Only available if using SSH
|
25
25
|
|
26
26
|
exclude:
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
27
|
+
- .git/
|
28
|
+
- .gitignore
|
29
|
+
- .sass-cache/
|
30
|
+
- node_modules/
|
31
|
+
- bin/
|
32
|
+
- tmp/*
|
33
|
+
- Gemfile*
|
34
|
+
- Movefile
|
35
|
+
- movefile
|
36
|
+
- movefile.yml
|
37
|
+
- movefile.yaml
|
38
|
+
- wp-config.php
|
39
|
+
- wp-content/*.sql.gz
|
40
40
|
|
41
41
|
# paths: # you can customize wordpress internal paths
|
42
|
-
# wp_content:
|
43
|
-
# uploads:
|
44
|
-
# plugins:
|
45
|
-
# mu_plugins:
|
46
|
-
# themes:
|
47
|
-
# languages:
|
42
|
+
# wp_content: wp-content
|
43
|
+
# uploads: wp-content/uploads
|
44
|
+
# plugins: wp-content/plugins
|
45
|
+
# mu_plugins: wp-content/mu-plugins
|
46
|
+
# themes: wp-content/themes
|
47
|
+
# languages: wp-content/languages
|
48
48
|
|
49
49
|
# ssh:
|
50
|
-
# host:
|
51
|
-
# user:
|
52
|
-
# password:
|
50
|
+
# host: host
|
51
|
+
# user: user
|
52
|
+
# password: password # password is optional, will use public keys if available.
|
53
53
|
# port: 22 # Port is optional
|
54
|
-
# rsync_options:
|
54
|
+
# rsync_options: --verbose # Additional rsync options, optional
|
55
55
|
# gateway: # Gateway is optional
|
56
|
-
# host:
|
57
|
-
# user:
|
58
|
-
# password:
|
56
|
+
# host: host
|
57
|
+
# user: user
|
58
|
+
# password: password # password is optional, will use public keys if available.
|
59
59
|
|
60
60
|
# ftp:
|
61
|
-
# user:
|
62
|
-
# password:
|
63
|
-
# host:
|
61
|
+
# user: user
|
62
|
+
# password: password
|
63
|
+
# host: host
|
64
64
|
# passive: true
|
65
|
-
# scheme:
|
65
|
+
# scheme: ftps # default ftp
|
66
66
|
|
67
67
|
# staging: # multiple environments can be specified
|
68
68
|
# [...]
|
data/lib/wordmove/logger.rb
CHANGED
@@ -4,10 +4,10 @@ module Wordmove
|
|
4
4
|
|
5
5
|
def task(title)
|
6
6
|
prefix = "▬" * 2
|
7
|
-
title = "
|
7
|
+
title = " #{title} "
|
8
8
|
padding = "▬" * padding_length(title)
|
9
9
|
|
10
|
-
puts "\n" + prefix + title.
|
10
|
+
puts "\n" + prefix + title.light_white + padding
|
11
11
|
end
|
12
12
|
|
13
13
|
def task_step(local_step, title)
|
@@ -19,15 +19,15 @@ module Wordmove
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def error(message)
|
22
|
-
puts " error".red + " | ".black + message.to_s
|
22
|
+
puts " ✗ error".red + " | ".black + message.to_s
|
23
23
|
end
|
24
24
|
|
25
25
|
def success(message)
|
26
|
-
puts " success".green + " | ".black + message.to_s
|
26
|
+
puts " ✓ success".green + " | ".black + message.to_s
|
27
27
|
end
|
28
28
|
|
29
29
|
def debug(message)
|
30
|
-
puts " debug".magenta + " | ".black + message.to_s
|
30
|
+
puts " ⚠ debug".magenta + " | ".black + message.to_s
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
data/lib/wordmove/version.rb
CHANGED
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: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-12-
|
15
|
+
date: 2017-12-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|