wordmove 5.0.2 → 5.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
- data/.github/ISSUE_TEMPLATE/discussion.md +10 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/stale.yml +17 -0
- data/.github/workflows/ruby.yml +30 -0
- data/CONTRIBUTING.md +86 -0
- data/LICENSE +21 -0
- data/README.mdown +39 -67
- data/lib/wordmove/assets/wordmove_schema_remote.yml +2 -2
- data/lib/wordmove/deployer/base.rb +2 -4
- data/lib/wordmove/hook.rb +2 -2
- data/lib/wordmove/movefile.rb +14 -5
- data/lib/wordmove/sql_adapter/wpcli.rb +27 -2
- data/lib/wordmove/version.rb +1 -1
- data/wordmove.gemspec +2 -2
- metadata +21 -21
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f06e5ea25d6f6ba6a89a0794f707054bd610332b13577da5f5927abb012e80b
|
4
|
+
data.tar.gz: 606d54185e3da1bc13027223105dd345e3a5af67420eabc5ed44bd4aea1e65ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beaf05a7ce50d11c7477bb7369c727c17ac4d98f541dbcfd383b90486541edba836086fec890df43ff4f9e78041df50be7cb356b3d0eba7de96e71ae122dd37f
|
7
|
+
data.tar.gz: d17d47f4febc8ea941aa4eb038c85c45c749105b92e23a59fb521b13c8bdf518edcd35de6208080e7847008763a7c38913dfe51eba702ba49823de7acc465887
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**Wordmove command**
|
14
|
+
Command used on the CLI: (e.g.: `wordmove pull --all --no-db`)
|
15
|
+
|
16
|
+
**Expected behavior**
|
17
|
+
A clear and concise description of what you expected to happen.
|
18
|
+
|
19
|
+
**movefile.yml**
|
20
|
+
Paste (removing personal data) the interesting part, if any, of your `movefile.yml` formatting it inside a code block with `yml` syntax and double checking the indentation.
|
21
|
+
|
22
|
+
**Exception/trace**
|
23
|
+
Paste (removing personal data) the entire trace of error/exception you encountered, if any
|
24
|
+
|
25
|
+
**Environment (please complete the following information):**
|
26
|
+
- OS:
|
27
|
+
- Ruby: (`ruby --version`)
|
28
|
+
- Wordmove: (`wordmove --version`)
|
29
|
+
|
30
|
+
**Doctor**
|
31
|
+
* [x] `wordmove doctor` is all green
|
32
|
+
|
33
|
+
(If it is not, report the error you got.)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: feature
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
data/.github/stale.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
2
|
+
daysUntilStale: 60
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
4
|
+
daysUntilClose: 7
|
5
|
+
# Issues with these labels will never be considered stale
|
6
|
+
exemptLabels:
|
7
|
+
- feature
|
8
|
+
- bug
|
9
|
+
# Label to use when marking an issue as stale
|
10
|
+
staleLabel: wontfix
|
11
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
12
|
+
markComment: >
|
13
|
+
This issue has been automatically marked as stale because it has not had
|
14
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
15
|
+
for your contributions.
|
16
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
17
|
+
closeComment: false
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Tests
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: 2.6
|
27
|
+
- name: Install dependencies
|
28
|
+
run: bundle install
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rake
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
Welcome to the contributor guide. If you can't find important information you're welcome
|
2
|
+
to edit this page or open a discussion issue to talk with maintainers.
|
3
|
+
|
4
|
+
In this guide you'll find informations about:
|
5
|
+
* [Bug reporting](#bug-reporting)
|
6
|
+
* [Development](#development)
|
7
|
+
* [Maintainer tasks](#maintainer-tasks)
|
8
|
+
|
9
|
+
### Bug reporting
|
10
|
+
|
11
|
+
Wordmove is an hard piece of software to debug and it is used by many users with many
|
12
|
+
different environments - Windows also, even if it isn't officially supported by the dev team.
|
13
|
+
|
14
|
+
So *please*, help the community adding some crucial informations and posting well
|
15
|
+
formatted code. Inspirational details:
|
16
|
+
|
17
|
+
* OS
|
18
|
+
* Ruby version
|
19
|
+
* Wordmove version
|
20
|
+
* Are you using system Ruby, rbenv or RVM?
|
21
|
+
* Describe at your best the action you required to Wordmove: push/pull, ftp/ssh
|
22
|
+
* Paste (safely) your full or partial `movefile.yml`
|
23
|
+
* Paste (safely) the entire trace of error/exception you encountered, if any
|
24
|
+
* If you paste code or the STDOUT log/trace **format them**. If it sound as a joke I swear I'm serious:
|
25
|
+
use GitHub's Markdown syntax to keep things readable if you'd like to discuss your problem with the community.
|
26
|
+
* Label the issue if you can
|
27
|
+
|
28
|
+
As a general advise: we tend to not support Wordmove's versions older than the latest stable.
|
29
|
+
We'd appreciate your help opening an in depth report if you'd find that an older version is working
|
30
|
+
better for you.
|
31
|
+
|
32
|
+
Thank you all for your support and for the love <3
|
33
|
+
|
34
|
+
### Development
|
35
|
+
|
36
|
+
#### Get Wordmove
|
37
|
+
|
38
|
+
* fork wordmove
|
39
|
+
* clone your own repo
|
40
|
+
* be sure to check-out the right branch, usually `master`
|
41
|
+
|
42
|
+
##### Installing Ruby
|
43
|
+
|
44
|
+
To install ruby, please, use [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io).
|
45
|
+
|
46
|
+
##### Contribute
|
47
|
+
|
48
|
+
* run `bundle install` to install gem dependencies
|
49
|
+
* `git checkout -b my_feature_or_fix_name`
|
50
|
+
* code, commit, push and send a pull request on GitHub
|
51
|
+
|
52
|
+
> Version bump is considered to be a maintainer's task, so please leave the version
|
53
|
+
alone while working on your branch.
|
54
|
+
|
55
|
+
|
56
|
+
##### Test Wordmove
|
57
|
+
|
58
|
+
Wordmove has a decent test coverage. We _require_ that pull requests does not break tests launched by the CI.
|
59
|
+
In order to launch tests on you dev machine
|
60
|
+
|
61
|
+
```fish
|
62
|
+
rake
|
63
|
+
```
|
64
|
+
|
65
|
+
The command will launch the test suite - written with RSpec - and rubocop.
|
66
|
+
|
67
|
+
In order to use the gem locally you can install it
|
68
|
+
|
69
|
+
```fish
|
70
|
+
rake install
|
71
|
+
wordmove --version
|
72
|
+
```
|
73
|
+
|
74
|
+
or run the executable directly
|
75
|
+
|
76
|
+
```fish
|
77
|
+
bin/wordmove --version
|
78
|
+
```
|
79
|
+
|
80
|
+
### Maintainer tasks
|
81
|
+
|
82
|
+
ToDo:
|
83
|
+
|
84
|
+
* [ ] versioning and version dumping
|
85
|
+
* [ ] changelog/release
|
86
|
+
* [ ] publishing the gem
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2013-2019 weLaika Soc. Coop.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.mdown
CHANGED
@@ -2,18 +2,17 @@
|
|
2
2
|
|
3
3
|
![logo](https://raw.githubusercontent.com/welaika/wordmove/master/assets/images/wordmove.png)
|
4
4
|
|
5
|
-
Wordmove is a
|
5
|
+
Wordmove is a command line tool that lets you automatically mirror local WordPress
|
6
6
|
installations and DB data back and forth from your local development machine to
|
7
|
-
|
7
|
+
one or more remote servers.
|
8
8
|
|
9
|
-
Wordmove has also a neat hook system which enables you to run arbitrary commands
|
10
|
-
before and after push/pull actions. Local and remote commands are both supported
|
11
|
-
ones
|
9
|
+
Wordmove has also a neat [hook](https://github.com/welaika/wordmove/wiki/Hooks) system which enables you to run arbitrary commands
|
10
|
+
before and after push/pull actions. Local and remote commands are both supported (remote
|
11
|
+
ones only on SSH protocol).
|
12
12
|
|
13
|
-
[FTP support has been discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), thus
|
14
|
-
while base functionalities are granted.
|
13
|
+
[FTP support development has been discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), thus not all features are granted when using this protocol.
|
15
14
|
|
16
|
-
[![
|
15
|
+
[![Tests](https://github.com/welaika/wordmove/workflows/Tests/badge.svg)](https://github.com/welaika/wordmove/actions)
|
17
16
|
[![Slack channel](https://img.shields.io/badge/Slack-WP--Hub-blue.svg)](https://wphub-auto-invitation.herokuapp.com/)
|
18
17
|
[![Gem Version](https://badge.fury.io/rb/wordmove.svg)](https://rubygems.org/gems/wordmove)
|
19
18
|
[![Docker Build Status](https://img.shields.io/docker/automated/welaika/wordmove.svg)](https://hub.docker.com/r/welaika/wordmove/)
|
@@ -21,7 +20,9 @@ while base functionalities are granted.
|
|
21
20
|
|
22
21
|
## Installation
|
23
22
|
|
24
|
-
|
23
|
+
Wordmove is developed in ruby and packaged and distributed as a gem.
|
24
|
+
|
25
|
+
To install:
|
25
26
|
|
26
27
|
gem install wordmove
|
27
28
|
|
@@ -29,17 +30,21 @@ And to update:
|
|
29
30
|
|
30
31
|
gem update wordmove
|
31
32
|
|
33
|
+
You can read more about ruby gems ecosystem on the official site https://rubygems.org/.
|
34
|
+
|
32
35
|
## Peer dependencies
|
33
36
|
|
34
|
-
Wordmove
|
37
|
+
Wordmove acts as automation glue between tools you already have and love. These are its peer dependencies which **you need to have installed** and executable through your system $PATH:
|
38
|
+
|
39
|
+
| Program | Mandatory? |
|
40
|
+
| --------- | -------------------------------- |
|
41
|
+
| rsync | Yes for SSH protocol |
|
42
|
+
| mysql | Yes |
|
43
|
+
| mysqldump | Yes |
|
44
|
+
| wp-cli | Yes by default, but configurable |
|
45
|
+
| lftp | Yes, for FTP protocol |
|
35
46
|
|
36
|
-
|
37
|
-
| ------- | ---------------------------- | ------------------------------- |
|
38
|
-
| rsync | Mirror files and dirs | Yes for SSH connections |
|
39
|
-
| mysql | Import database | Yes |
|
40
|
-
| mysqldump | Dump database | Yes |
|
41
|
-
| wp-cli | Adapt database | Yes by default, but configurable|
|
42
|
-
| lftp | all | Yes, for FTP connections |
|
47
|
+
Wordmove also expect that the remote server will have the following commands: `gzip`, `nice`, `mysql`, `rsync`. All of these should be always present by default on any WordPress hosting.
|
43
48
|
|
44
49
|
## Usage
|
45
50
|
|
@@ -59,11 +64,17 @@ Move inside the WordPress folder and use `wordmove init` to generate a new `move
|
|
59
64
|
|
60
65
|
**See the wiki article: [Usage and flags explained](https://github.com/welaika/wordmove/wiki/Usage-and-flags-explained) for more info.**
|
61
66
|
|
62
|
-
### Screencasts
|
63
67
|
|
64
|
-
|
65
|
-
|
66
|
-
|
68
|
+
|
69
|
+
### Multistage
|
70
|
+
|
71
|
+
You can define multiple remote environments in your `movefile.yml`, such as production, staging, etc. Every first level key in the YAML other than the defaults and mandatory `global` and `local` will be interpreted as a remote environment.
|
72
|
+
|
73
|
+
Use `-e` with `pull` or `push` to run the command on the specified environment.
|
74
|
+
|
75
|
+
For example: `wordmove push -e staging -d` will push your local database to the staging environment.
|
76
|
+
|
77
|
+
We warmly **recommend to read the wiki article**: [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
|
67
78
|
|
68
79
|
## movefile.yml
|
69
80
|
|
@@ -141,24 +152,12 @@ production:
|
|
141
152
|
# where: remote
|
142
153
|
```
|
143
154
|
|
144
|
-
|
145
|
-
](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained) if you need multi-stage support,
|
146
|
-
and the wiki article [Movefile configurations explained](https://github.com/welaika/wordmove/wiki/movefile.yml-configurations-explained)
|
147
|
-
to understand about the supported configurations.**
|
155
|
+
We warmly **recommend to read the wiki articles**
|
148
156
|
|
149
|
-
|
157
|
+
* [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
|
158
|
+
* [Movefile configurations explained](https://github.com/welaika/wordmove/wiki/movefile.yml-configurations-explained)
|
150
159
|
|
151
|
-
|
152
|
-
Use `-e` with `pull` or `push` to run the command on the specified environment.
|
153
|
-
|
154
|
-
For example:
|
155
|
-
|
156
|
-
wordmove push -e staging -d
|
157
|
-
|
158
|
-
will push your local database to the staging environment only.
|
159
|
-
|
160
|
-
We warmly **recommend** to read the wiki article: [Multiple environments explained
|
161
|
-
](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
|
160
|
+
to understand more about supported configurations.
|
162
161
|
|
163
162
|
## Environment Variables
|
164
163
|
|
@@ -171,6 +170,7 @@ Environment variables are written using the **ERB tags** syntax:
|
|
171
170
|
```
|
172
171
|
|
173
172
|
### Variables set up
|
173
|
+
|
174
174
|
Environment variables can be set up using two methods:
|
175
175
|
|
176
176
|
#### Using the shell:
|
@@ -281,38 +281,10 @@ Visit [Wordpress Tools](https://www.wptools.it).
|
|
281
281
|
|
282
282
|
## Contribute
|
283
283
|
|
284
|
-
|
285
|
-
We will accordingly tag and release or pre-release versions to the rubygems.org repository.
|
286
|
-
Do not consider the `dev` branch for your forks and PR.
|
287
|
-
We will never more use version-named branches as in the past, but we'll tag release on `master` and pre-release on `dev`.
|
288
|
-
|
289
|
-
### Please, **read the full [contributor guide](https://github.com/welaika/wordmove/wiki/Contributor-Guide)**.
|
284
|
+
Please, read the [contributor guide](https://github.com/welaika/wordmove/blob/master/CONTRIBUTING.md).
|
290
285
|
|
291
|
-
Feel free to open
|
286
|
+
Feel free to open a discussion issue about contribution if you need more info.
|
292
287
|
|
293
288
|
## Author
|
294
289
|
|
295
290
|
made with ❤️ and ☕️ by [weLaika](https://dev.welaika.com)
|
296
|
-
|
297
|
-
## License
|
298
|
-
|
299
|
-
(The MIT License)
|
300
|
-
|
301
|
-
Copyright © 2013-2019 weLaika
|
302
|
-
|
303
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
304
|
-
this software and associated documentation files (the ‘Software’), to deal in
|
305
|
-
the Software without restriction, including without limitation the rights to
|
306
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
307
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
308
|
-
subject to the following conditions:
|
309
|
-
|
310
|
-
The above copyright notice and this permission notice shall be included in all
|
311
|
-
copies or substantial portions of the Software.
|
312
|
-
|
313
|
-
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
314
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
315
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
316
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
317
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
318
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -162,7 +162,7 @@ mapping:
|
|
162
162
|
type: bool
|
163
163
|
uploads:
|
164
164
|
type: bool
|
165
|
-
|
165
|
+
mu_plugins:
|
166
166
|
type: bool
|
167
167
|
push:
|
168
168
|
type: map
|
@@ -177,5 +177,5 @@ mapping:
|
|
177
177
|
type: bool
|
178
178
|
uploads:
|
179
179
|
type: bool
|
180
|
-
|
180
|
+
mu_plugins:
|
181
181
|
type: bool
|
@@ -100,11 +100,9 @@ module Wordmove
|
|
100
100
|
|
101
101
|
return true if simulate?
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
file << open(url).read
|
103
|
+
File.open(local_path, 'w') do |file|
|
104
|
+
file << URI.open(url).read
|
106
105
|
end
|
107
|
-
# rubocop:enable Security/Open
|
108
106
|
end
|
109
107
|
|
110
108
|
def simulate?
|
data/lib/wordmove/hook.rb
CHANGED
@@ -78,7 +78,7 @@ module Wordmove
|
|
78
78
|
|
79
79
|
class Local
|
80
80
|
def self.logger
|
81
|
-
|
81
|
+
Wordmove::Hook.logger
|
82
82
|
end
|
83
83
|
|
84
84
|
def self.run(command_hash, options, simulate = false)
|
@@ -101,7 +101,7 @@ module Wordmove
|
|
101
101
|
|
102
102
|
class Remote
|
103
103
|
def self.logger
|
104
|
-
|
104
|
+
Wordmove::Hook.logger
|
105
105
|
end
|
106
106
|
|
107
107
|
def self.run(command_hash, options, simulate = false)
|
data/lib/wordmove/movefile.rb
CHANGED
@@ -47,11 +47,20 @@ module Wordmove
|
|
47
47
|
available_enviroments = extract_available_envs(options)
|
48
48
|
options.merge!(cli_options).deep_symbolize_keys!
|
49
49
|
|
50
|
-
if
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
if options[:environment] != 'local'
|
51
|
+
if available_enviroments.size > 1 && options[:environment].nil?
|
52
|
+
raise(
|
53
|
+
UndefinedEnvironment,
|
54
|
+
"You need to specify an environment with --environment parameter"
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
if options[:environment].present?
|
59
|
+
unless available_enviroments.include?(options[:environment].to_sym)
|
60
|
+
raise UndefinedEnvironment, "No environment found for \"#{options[:environment]}\". "\
|
61
|
+
"Available Environments: #{available_enviroments.join(' ')}"
|
62
|
+
end
|
63
|
+
end
|
55
64
|
end
|
56
65
|
|
57
66
|
(options[:environment] || available_enviroments.first).to_sym
|
@@ -15,8 +15,17 @@ module Wordmove
|
|
15
15
|
raise UnmetPeerDependencyError, "WP-CLI is not installed or not in your $PATH"
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
opts = [
|
19
|
+
"--path=#{cli_config_path}",
|
20
|
+
from,
|
21
|
+
to,
|
22
|
+
"--quiet",
|
23
|
+
"--skip-columns=guid",
|
24
|
+
"--all-tables",
|
25
|
+
"--allow-root"
|
26
|
+
]
|
27
|
+
|
28
|
+
"wp search-replace #{opts.join(' ')}"
|
20
29
|
end
|
21
30
|
|
22
31
|
private
|
@@ -24,6 +33,22 @@ module Wordmove
|
|
24
33
|
def wp_in_path?
|
25
34
|
system('which wp > /dev/null 2>&1')
|
26
35
|
end
|
36
|
+
|
37
|
+
def cli_config_path
|
38
|
+
load_from_yml || load_from_cli || local_path
|
39
|
+
end
|
40
|
+
|
41
|
+
def load_from_yml
|
42
|
+
cli_config_path = File.join(local_path, "wp-cli.yml")
|
43
|
+
return unless File.exist?(cli_config_path)
|
44
|
+
|
45
|
+
YAML.load_file(cli_config_path).with_indifferent_access["path"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def load_from_cli
|
49
|
+
cli_config = JSON.parse(`wp cli param-dump --with-values`, symbolize_names: true)
|
50
|
+
cli_config.dig(:path, :current)
|
51
|
+
end
|
27
52
|
end
|
28
53
|
end
|
29
54
|
end
|
data/lib/wordmove/version.rb
CHANGED
data/wordmove.gemspec
CHANGED
@@ -29,11 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_runtime_dependency "activesupport", '~>
|
32
|
+
spec.add_runtime_dependency "activesupport", '~> 6.1'
|
33
33
|
spec.add_runtime_dependency "colorize", "~> 0.8.1"
|
34
34
|
spec.add_runtime_dependency "dotenv", "~> 2.7.5"
|
35
35
|
spec.add_runtime_dependency "kwalify", "~> 0"
|
36
|
-
spec.add_runtime_dependency "photocopier", "~> 1.
|
36
|
+
spec.add_runtime_dependency "photocopier", "~> 1.4", ">= 1.4.0"
|
37
37
|
spec.add_runtime_dependency "thor", "~> 0.20.3"
|
38
38
|
|
39
39
|
spec.required_ruby_version = ">= 2.6.0"
|
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: 5.
|
4
|
+
version: 5.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
- Fabrizio Monti
|
10
10
|
- Alessandro Fazzi
|
11
11
|
- Filippo Gangi Dino
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
@@ -20,20 +20,14 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 5.1.1
|
23
|
+
version: '6.1'
|
27
24
|
type: :runtime
|
28
25
|
prerelease: false
|
29
26
|
version_requirements: !ruby/object:Gem::Requirement
|
30
27
|
requirements:
|
31
28
|
- - "~>"
|
32
29
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 5.1.1
|
30
|
+
version: '6.1'
|
37
31
|
- !ruby/object:Gem::Dependency
|
38
32
|
name: colorize
|
39
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,22 +74,22 @@ dependencies:
|
|
80
74
|
name: photocopier
|
81
75
|
requirement: !ruby/object:Gem::Requirement
|
82
76
|
requirements:
|
83
|
-
- - "~>"
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '1.3'
|
86
77
|
- - ">="
|
87
78
|
- !ruby/object:Gem::Version
|
88
|
-
version: 1.
|
79
|
+
version: 1.4.0
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.4'
|
89
83
|
type: :runtime
|
90
84
|
prerelease: false
|
91
85
|
version_requirements: !ruby/object:Gem::Requirement
|
92
86
|
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '1.3'
|
96
87
|
- - ">="
|
97
88
|
- !ruby/object:Gem::Version
|
98
|
-
version: 1.
|
89
|
+
version: 1.4.0
|
90
|
+
- - "~>"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '1.4'
|
99
93
|
- !ruby/object:Gem::Dependency
|
100
94
|
name: thor
|
101
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,15 +214,21 @@ executables:
|
|
220
214
|
extensions: []
|
221
215
|
extra_rdoc_files: []
|
222
216
|
files:
|
217
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
218
|
+
- ".github/ISSUE_TEMPLATE/discussion.md"
|
219
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
220
|
+
- ".github/stale.yml"
|
221
|
+
- ".github/workflows/ruby.yml"
|
223
222
|
- ".gitignore"
|
224
223
|
- ".rspec"
|
225
224
|
- ".rubocop.yml"
|
226
225
|
- ".ruby-gemset"
|
227
226
|
- ".ruby-version"
|
228
|
-
- ".travis.yml"
|
229
227
|
- ".vscode/launch.json"
|
230
228
|
- CHANGELOG.md
|
229
|
+
- CONTRIBUTING.md
|
231
230
|
- Gemfile
|
231
|
+
- LICENSE
|
232
232
|
- README.mdown
|
233
233
|
- Rakefile
|
234
234
|
- assets/images/wordmove.png
|
@@ -314,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
314
|
version: '0'
|
315
315
|
requirements: []
|
316
316
|
rubygems_version: 3.0.3
|
317
|
-
signing_key:
|
317
|
+
signing_key:
|
318
318
|
specification_version: 4
|
319
319
|
summary: Wordmove, Capistrano for Wordpress
|
320
320
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.6.5
|
5
|
-
|
6
|
-
cache: bundler
|
7
|
-
|
8
|
-
before_install:
|
9
|
-
- gem update --system
|
10
|
-
- gem install bundler
|
11
|
-
|
12
|
-
install:
|
13
|
-
- bundle install --jobs=3 --retry=3
|
14
|
-
|
15
|
-
deploy:
|
16
|
-
provider: script
|
17
|
-
script: bash deploy/deploy.sh
|
18
|
-
on:
|
19
|
-
tags: true
|
20
|
-
branch: master
|
21
|
-
ruby: '2.6.5'
|