wordmove 6.0.0.alpha.3 → 6.0.0.alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wordmove/actions/adapt_local_db.rb +0 -2
- data/lib/wordmove/actions/adapt_remote_db.rb +0 -2
- data/lib/wordmove/actions/backup_local_db.rb +1 -3
- data/lib/wordmove/actions/ftp/backup_remote_db.rb +0 -2
- data/lib/wordmove/actions/ftp/cleanup_after_adapt.rb +0 -2
- data/lib/wordmove/actions/ftp/download_remote_db.rb +0 -2
- data/lib/wordmove/actions/ftp/put_and_import_dump_remotely.rb +0 -2
- data/lib/wordmove/actions/setup_context_for_db.rb +0 -5
- data/lib/wordmove/actions/ssh/backup_remote_db.rb +0 -2
- data/lib/wordmove/actions/ssh/cleanup_after_adapt.rb +0 -2
- data/lib/wordmove/actions/ssh/download_remote_db.rb +0 -2
- data/lib/wordmove/actions/ssh/put_and_import_dump_remotely.rb +0 -2
- data/lib/wordmove/organizers/ftp/pull.rb +9 -8
- data/lib/wordmove/organizers/ftp/push.rb +10 -9
- data/lib/wordmove/organizers/ssh/pull.rb +9 -8
- data/lib/wordmove/organizers/ssh/push.rb +10 -9
- data/lib/wordmove/version.rb +1 -1
- data/lib/wordmove/wpcli.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff2399e2a947da60d6acac49fb8dc6beb32f3571d4f79cf5f1ea0c5f8f0fcfe6
|
4
|
+
data.tar.gz: 1aa500f453341eceb9a1d82d03abec6c139de29806b840d0844f578241ae696c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3480a25ffeff1808227e5036dc4c7e0d69d92822019b3ffb3e5d47b54bf60809d1a0951c3ee38574dd9e9f345ddcff7d49e92ab171c5930e8d2d0d9f886fd0
|
7
|
+
data.tar.gz: 5c742c2644d644f9f3d61c0d77dbc15c69957244f98c20dade5e04867b59d55202b88449ea1a9f5ff9ca2952a7e43b1db24fdf8c4e4d387438dd8b0807317096
|
@@ -30,8 +30,6 @@ module Wordmove
|
|
30
30
|
# @!scope class
|
31
31
|
# @return [LightService::Context] Action's context
|
32
32
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
33
|
-
next context if context.database_task == false
|
34
|
-
|
35
33
|
context.logger.task 'Adapt local DB'
|
36
34
|
|
37
35
|
unless wp_in_path?
|
@@ -30,8 +30,6 @@ module Wordmove
|
|
30
30
|
# @!scope class
|
31
31
|
# @return [LightService::Context] Action's context
|
32
32
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
33
|
-
next context if context.database_task == false
|
34
|
-
|
35
33
|
context.logger.task 'Adapt remote DB'
|
36
34
|
|
37
35
|
unless wp_in_path?
|
@@ -20,9 +20,7 @@ module Wordmove
|
|
20
20
|
# @param logger [Wordmove::Logger]
|
21
21
|
# @!scope class
|
22
22
|
# @return [LightService::Context] Action's context
|
23
|
-
executed do |context|
|
24
|
-
next context if context.database_task == false
|
25
|
-
|
23
|
+
executed do |context|
|
26
24
|
context.logger.task 'Backup local DB'
|
27
25
|
|
28
26
|
if simulate?(cli_options: context.cli_options)
|
@@ -21,8 +21,6 @@ module Wordmove
|
|
21
21
|
# @!scope class
|
22
22
|
# @return [LightService::Context] Action's context
|
23
23
|
executed do |context|
|
24
|
-
next context if context.database_task == false
|
25
|
-
|
26
24
|
context.logger.task 'Backup remote DB'
|
27
25
|
|
28
26
|
if simulate?(cli_options: context.cli_options)
|
@@ -19,8 +19,6 @@ module Wordmove
|
|
19
19
|
# @!scope class
|
20
20
|
# @return [LightService::Context] Action's context
|
21
21
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
22
|
-
next context if context.database_task == false
|
23
|
-
|
24
22
|
context.logger.task 'Cleanup'
|
25
23
|
|
26
24
|
if simulate?(cli_options: context.cli_options)
|
@@ -25,8 +25,6 @@ module Wordmove
|
|
25
25
|
# @!scope class
|
26
26
|
# @return [LightService::Context] Action's context
|
27
27
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
28
|
-
next context if context.database_task == false
|
29
|
-
|
30
28
|
context.logger.task 'Download remote DB'
|
31
29
|
|
32
30
|
if simulate?(cli_options: context.cli_options)
|
@@ -25,8 +25,6 @@ module Wordmove
|
|
25
25
|
# @!scope class
|
26
26
|
# @return [LightService::Context] Action's context
|
27
27
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
28
|
-
next context if context.database_task == false
|
29
|
-
|
30
28
|
context.logger.task 'Upload and import adapted DB'
|
31
29
|
|
32
30
|
result = Wordmove::Actions::PutFile.execute(
|
@@ -16,11 +16,6 @@ module Wordmove
|
|
16
16
|
promises :db_paths
|
17
17
|
|
18
18
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
19
|
-
if context.database_task == false
|
20
|
-
context.db_paths = false
|
21
|
-
next context
|
22
|
-
end
|
23
|
-
|
24
19
|
next context if simulate?(cli_options: context.cli_options)
|
25
20
|
|
26
21
|
content_dir = local_wp_content_dir(local_options: context.local_options)
|
@@ -17,8 +17,6 @@ module Wordmove
|
|
17
17
|
# @!scope class
|
18
18
|
# @return [LightService::Context] Action's context
|
19
19
|
executed do |context|
|
20
|
-
next context if context.database_task == false
|
21
|
-
|
22
20
|
context.logger.task 'Backup remote DB'
|
23
21
|
|
24
22
|
if simulate?(cli_options: context.cli_options)
|
@@ -17,8 +17,6 @@ module Wordmove
|
|
17
17
|
# @!scope class
|
18
18
|
# @return [LightService::Context] Action's context
|
19
19
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
20
|
-
next context if context.database_task == false
|
21
|
-
|
22
20
|
context.logger.task 'Cleanup'
|
23
21
|
|
24
22
|
if simulate?(cli_options: context.cli_options)
|
@@ -24,8 +24,6 @@ module Wordmove
|
|
24
24
|
# @!scope class
|
25
25
|
# @return [LightService::Context] Action's context
|
26
26
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
27
|
-
next context if context.database_task == false
|
28
|
-
|
29
27
|
context.logger.task 'Download remote DB'
|
30
28
|
|
31
29
|
next context if simulate?(cli_options: context.cli_options)
|
@@ -24,8 +24,6 @@ module Wordmove
|
|
24
24
|
# @!scope class
|
25
25
|
# @return [LightService::Context] Action's context
|
26
26
|
executed do |context| # rubocop:disable Metrics/BlockLength
|
27
|
-
next context if context.database_task == false
|
28
|
-
|
29
27
|
context.logger.task 'Upload and import adapted DB'
|
30
28
|
|
31
29
|
result = Wordmove::Actions::PutFile.execute(
|
@@ -35,14 +35,15 @@ module Wordmove
|
|
35
35
|
->(ctx) { ctx.wordpress_task },
|
36
36
|
[Wordmove::Actions::Ftp::PullWordpress]
|
37
37
|
),
|
38
|
-
iterate(:folder_tasks, [Wordmove::Actions::Ftp::GetDirectory])
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
iterate(:folder_tasks, [Wordmove::Actions::Ftp::GetDirectory]),
|
39
|
+
reduce_if(->(ctx) { ctx.database_task },
|
40
|
+
[
|
41
|
+
Wordmove::Actions::SetupContextForDb,
|
42
|
+
Wordmove::Actions::BackupLocalDb,
|
43
|
+
Wordmove::Actions::Ftp::DownloadRemoteDb,
|
44
|
+
Wordmove::Actions::AdaptRemoteDb,
|
45
|
+
Wordmove::Actions::Ftp::CleanupAfterAdapt
|
46
|
+
]),
|
46
47
|
Wordmove::Actions::RunAfterPullHook # Will fail and warn the user
|
47
48
|
]
|
48
49
|
end
|
@@ -35,15 +35,16 @@ module Wordmove
|
|
35
35
|
->(ctx) { ctx.wordpress_task },
|
36
36
|
[Wordmove::Actions::Ftp::PushWordpress]
|
37
37
|
),
|
38
|
-
iterate(:folder_tasks, [Wordmove::Actions::Ftp::PutDirectory])
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
iterate(:folder_tasks, [Wordmove::Actions::Ftp::PutDirectory]),
|
39
|
+
reduce_if(->(ctx) { ctx.database_task },
|
40
|
+
[
|
41
|
+
Wordmove::Actions::SetupContextForDb,
|
42
|
+
Wordmove::Actions::Ftp::DownloadRemoteDb,
|
43
|
+
Wordmove::Actions::Ftp::BackupRemoteDb,
|
44
|
+
Wordmove::Actions::AdaptLocalDb,
|
45
|
+
Wordmove::Actions::Ftp::PutAndImportDumpRemotely,
|
46
|
+
Wordmove::Actions::Ftp::CleanupAfterAdapt
|
47
|
+
]),
|
47
48
|
Wordmove::Actions::RunAfterPushHook # Will fail and warn the user
|
48
49
|
]
|
49
50
|
end
|
@@ -35,14 +35,15 @@ module Wordmove
|
|
35
35
|
->(ctx) { ctx.wordpress_task },
|
36
36
|
[Wordmove::Actions::Ssh::PullWordpress]
|
37
37
|
),
|
38
|
-
iterate(:folder_tasks, [Wordmove::Actions::Ssh::GetDirectory])
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
iterate(:folder_tasks, [Wordmove::Actions::Ssh::GetDirectory]),
|
39
|
+
reduce_if(->(ctx) { ctx.database_task },
|
40
|
+
[
|
41
|
+
Wordmove::Actions::SetupContextForDb,
|
42
|
+
Wordmove::Actions::BackupLocalDb,
|
43
|
+
Wordmove::Actions::Ssh::DownloadRemoteDb,
|
44
|
+
Wordmove::Actions::AdaptRemoteDb,
|
45
|
+
Wordmove::Actions::Ssh::CleanupAfterAdapt
|
46
|
+
]),
|
46
47
|
Wordmove::Actions::RunAfterPullHook
|
47
48
|
]
|
48
49
|
end
|
@@ -35,15 +35,16 @@ module Wordmove
|
|
35
35
|
->(ctx) { ctx.wordpress_task },
|
36
36
|
[Wordmove::Actions::Ssh::PushWordpress]
|
37
37
|
),
|
38
|
-
iterate(:folder_tasks, [Wordmove::Actions::Ssh::PutDirectory])
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
iterate(:folder_tasks, [Wordmove::Actions::Ssh::PutDirectory]),
|
39
|
+
reduce_if(->(ctx) { ctx.database_task },
|
40
|
+
[
|
41
|
+
Wordmove::Actions::SetupContextForDb,
|
42
|
+
Wordmove::Actions::Ssh::DownloadRemoteDb,
|
43
|
+
Wordmove::Actions::Ssh::BackupRemoteDb,
|
44
|
+
Wordmove::Actions::AdaptLocalDb,
|
45
|
+
Wordmove::Actions::Ssh::PutAndImportDumpRemotely,
|
46
|
+
Wordmove::Actions::Ssh::CleanupAfterAdapt
|
47
|
+
]),
|
47
48
|
Wordmove::Actions::RunAfterPushHook
|
48
49
|
]
|
49
50
|
end
|
data/lib/wordmove/version.rb
CHANGED
data/lib/wordmove/wpcli.rb
CHANGED
@@ -33,8 +33,8 @@ module Wordmove
|
|
33
33
|
[
|
34
34
|
'wp search-replace',
|
35
35
|
"--path=#{wpcli_config_path(context)}",
|
36
|
-
context.remote_options
|
37
|
-
context.local_options
|
36
|
+
context.dig(:remote_options, config_key),
|
37
|
+
context.dig(:local_options, config_key),
|
38
38
|
'--quiet',
|
39
39
|
'--skip-columns=guid',
|
40
40
|
'--all-tables',
|
@@ -50,7 +50,7 @@ module Wordmove
|
|
50
50
|
# @return [String]
|
51
51
|
# @!scope class
|
52
52
|
def wpcli_config_path(context)
|
53
|
-
load_from_yml(context) || load_from_wpcli || context.local_options
|
53
|
+
load_from_yml(context) || load_from_wpcli || context.dig(:local_options, :wordpress_path)
|
54
54
|
end
|
55
55
|
|
56
56
|
# If wordpress installation brings a `wp-cli.yml` file in its root folder,
|
@@ -60,7 +60,7 @@ module Wordmove
|
|
60
60
|
# @!scope class
|
61
61
|
# @!visibility private
|
62
62
|
def load_from_yml(context)
|
63
|
-
yml_path = File.join(context.local_options
|
63
|
+
yml_path = File.join(context.dig(:local_options, :wordpress_path), 'wp-cli.yml')
|
64
64
|
|
65
65
|
return unless File.exist?(yml_path)
|
66
66
|
|
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: 6.0.0.alpha.
|
4
|
+
version: 6.0.0.alpha.4
|
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: 2021-12-
|
15
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|