wordmove 6.0.0.alpha.1 → 6.0.0.alpha.2
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 +14 -6
- data/lib/wordmove/actions/adapt_remote_db.rb +4 -1
- data/lib/wordmove/actions/backup_local_db.rb +6 -2
- data/lib/wordmove/actions/ftp/backup_remote_db.rb +2 -0
- data/lib/wordmove/actions/ftp/cleanup_after_adapt.rb +3 -1
- data/lib/wordmove/actions/ftp/download_remote_db.rb +2 -0
- data/lib/wordmove/actions/ftp/put_and_import_dump_remotely.rb +10 -1
- data/lib/wordmove/actions/setup_context_for_db.rb +0 -1
- data/lib/wordmove/actions/ssh/backup_remote_db.rb +2 -0
- data/lib/wordmove/actions/ssh/cleanup_after_adapt.rb +16 -2
- data/lib/wordmove/actions/ssh/download_remote_db.rb +2 -0
- data/lib/wordmove/actions/ssh/put_and_import_dump_remotely.rb +8 -1
- data/lib/wordmove/version.rb +1 -1
- 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: 6a182f54bea0a027d35316cdf368c0c3c98a706bdc3bfbc176190fb7928a98df
|
4
|
+
data.tar.gz: 21ad918da1375bff9004661fcc6f2a3a951fe075b2d9baa722230137d0df7648
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 566f88fff0e931d3c9df3cb3a5f121be2e9f43ab8ba6ed7e5f33db3168e84f5b92b8c8b34cee36ef2304d4c478ee1fffbbcf64b3d6864fe6b0cddd2017e64bab
|
7
|
+
data.tar.gz: a2ccc8a72bfb597a600acfdffe0e1df4800e5bf34c0dc66d21fbf6d12c9c0f4163585a025cb37ea67f0d79adcfeef6ab901a18be5dddc099d17b0848c3bb7f60
|
@@ -30,6 +30,8 @@ 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
|
+
|
33
35
|
context.logger.task 'Adapt local DB'
|
34
36
|
|
35
37
|
unless wp_in_path?
|
@@ -38,7 +40,7 @@ module Wordmove
|
|
38
40
|
|
39
41
|
next context if simulate?(cli_options: context.cli_options)
|
40
42
|
|
41
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
43
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
42
44
|
cli_options: context.cli_options,
|
43
45
|
logger: context.logger,
|
44
46
|
command: mysql_dump_command(
|
@@ -46,24 +48,27 @@ module Wordmove
|
|
46
48
|
save_to_path: context.db_paths.local.path
|
47
49
|
)
|
48
50
|
)
|
51
|
+
context.fail_and_return!(result.message) if result.failure?
|
49
52
|
|
50
53
|
if context.cli_options[:no_adapt]
|
51
54
|
context.logger.warn 'Skipping DB adapt'
|
52
55
|
else
|
53
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
56
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
54
57
|
cli_options: context.cli_options,
|
55
58
|
logger: context.logger,
|
56
59
|
command: wpcli_search_replace_command(context, :vhost)
|
57
60
|
)
|
61
|
+
context.fail_and_return!(result.message) if result.failure?
|
58
62
|
|
59
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
63
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
60
64
|
cli_options: context.cli_options,
|
61
65
|
logger: context.logger,
|
62
66
|
command: wpcli_search_replace_command(context, :wordpress_path)
|
63
67
|
)
|
68
|
+
context.fail_and_return!(result.message) if result.failure?
|
64
69
|
end
|
65
70
|
|
66
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
71
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
67
72
|
cli_options: context.cli_options,
|
68
73
|
|
69
74
|
logger: context.logger,
|
@@ -72,16 +77,18 @@ module Wordmove
|
|
72
77
|
save_to_path: context.db_paths.local.adapted_path
|
73
78
|
)
|
74
79
|
)
|
80
|
+
context.fail_and_return!(result.message) if result.failure?
|
75
81
|
|
76
82
|
if context.photocopier.is_a? Photocopier::SSH
|
77
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
83
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
78
84
|
cli_options: context.cli_options,
|
79
85
|
logger: context.logger,
|
80
86
|
command: compress_command(file_path: context.db_paths.local.adapted_path)
|
81
87
|
)
|
88
|
+
context.fail_and_return!(result.message) if result.failure?
|
82
89
|
end
|
83
90
|
|
84
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
91
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
85
92
|
cli_options: context.cli_options,
|
86
93
|
logger: context.logger,
|
87
94
|
command: mysql_import_command(
|
@@ -89,6 +96,7 @@ module Wordmove
|
|
89
96
|
env_db_options: context.local_options[:database]
|
90
97
|
)
|
91
98
|
)
|
99
|
+
context.fail_and_return!(result.message) if result.failure?
|
92
100
|
end
|
93
101
|
end
|
94
102
|
end
|
@@ -30,6 +30,8 @@ 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
|
+
|
33
35
|
context.logger.task 'Adapt remote DB'
|
34
36
|
|
35
37
|
unless wp_in_path?
|
@@ -52,7 +54,7 @@ module Wordmove
|
|
52
54
|
)
|
53
55
|
end
|
54
56
|
|
55
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
57
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
56
58
|
cli_options: context.cli_options,
|
57
59
|
logger: context.logger,
|
58
60
|
command: mysql_import_command(
|
@@ -60,6 +62,7 @@ module Wordmove
|
|
60
62
|
env_db_options: context.local_options[:database]
|
61
63
|
)
|
62
64
|
)
|
65
|
+
context.fail_and_return!(result.message) if result.failure?
|
63
66
|
|
64
67
|
if context.cli_options[:no_adapt]
|
65
68
|
context.logger.warn 'Skipping DB adapt'
|
@@ -21,6 +21,8 @@ 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
|
+
|
24
26
|
context.logger.task 'Backup local DB'
|
25
27
|
|
26
28
|
if simulate?(cli_options: context.cli_options)
|
@@ -30,7 +32,7 @@ module Wordmove
|
|
30
32
|
next context
|
31
33
|
end
|
32
34
|
|
33
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
35
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
34
36
|
cli_options: context.cli_options,
|
35
37
|
logger: context.logger,
|
36
38
|
command: mysql_dump_command(
|
@@ -38,12 +40,14 @@ module Wordmove
|
|
38
40
|
save_to_path: context.db_paths.backup.local.path
|
39
41
|
)
|
40
42
|
)
|
43
|
+
context.fail_and_return!(result.message) if result.failure?
|
41
44
|
|
42
|
-
Wordmove::Actions::RunLocalCommand.execute(
|
45
|
+
result = Wordmove::Actions::RunLocalCommand.execute(
|
43
46
|
cli_options: context.cli_options,
|
44
47
|
logger: context.logger,
|
45
48
|
command: compress_command(file_path: context.db_paths.backup.local.path)
|
46
49
|
)
|
50
|
+
context.fail_and_return!(result.message) if result.failure?
|
47
51
|
|
48
52
|
context.logger.success(
|
49
53
|
"Backup saved at #{context.db_paths.backup.local.gzipped_path}"
|
@@ -21,6 +21,8 @@ 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
|
+
|
24
26
|
context.logger.task 'Backup remote DB'
|
25
27
|
|
26
28
|
if simulate?(cli_options: context.cli_options)
|
@@ -19,6 +19,8 @@ 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
|
+
|
22
24
|
context.logger.task 'Cleanup'
|
23
25
|
|
24
26
|
if simulate?(cli_options: context.cli_options)
|
@@ -33,7 +35,7 @@ module Wordmove
|
|
33
35
|
)
|
34
36
|
|
35
37
|
if result.failure?
|
36
|
-
context.logger.warning 'Failed to delete
|
38
|
+
context.logger.warning 'Failed to delete local file ' \
|
37
39
|
"#{context.db_paths.local.path} because: " \
|
38
40
|
"#{result.message}" \
|
39
41
|
'. Manual intervention required'
|
@@ -25,6 +25,8 @@ 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
|
+
|
28
30
|
context.logger.task 'Download remote DB'
|
29
31
|
|
30
32
|
if simulate?(cli_options: context.cli_options)
|
@@ -25,6 +25,8 @@ 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
|
+
|
28
30
|
context.logger.task 'Upload and import adapted DB'
|
29
31
|
|
30
32
|
result = Wordmove::Actions::PutFile.execute(
|
@@ -61,11 +63,18 @@ module Wordmove
|
|
61
63
|
if context.cli_options[:debug]
|
62
64
|
context.logger.debug "Operation log located at: #{context.db_paths.ftp.local.temp_path}"
|
63
65
|
else
|
64
|
-
Wordmove::Actions::DeleteLocalFile.execute(
|
66
|
+
result = Wordmove::Actions::DeleteLocalFile.execute(
|
65
67
|
cli_options: context.cli_options,
|
66
68
|
logger: context.logger,
|
67
69
|
file_path: context.db_paths.ftp.local.temp_path
|
68
70
|
)
|
71
|
+
|
72
|
+
if result.failure?
|
73
|
+
context.logger.warning 'Failed to delete local file ' \
|
74
|
+
"#{context.db_paths.ftp.local.temp_path} because: " \
|
75
|
+
"#{result.message}" \
|
76
|
+
'. Manual intervention required'
|
77
|
+
end
|
69
78
|
end
|
70
79
|
end
|
71
80
|
end
|
@@ -17,6 +17,8 @@ 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
|
+
|
20
22
|
context.logger.task 'Backup remote DB'
|
21
23
|
|
22
24
|
if simulate?(cli_options: context.cli_options)
|
@@ -17,6 +17,8 @@ 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
|
+
|
20
22
|
context.logger.task 'Cleanup'
|
21
23
|
|
22
24
|
if simulate?(cli_options: context.cli_options)
|
@@ -24,17 +26,29 @@ module Wordmove
|
|
24
26
|
next context
|
25
27
|
end
|
26
28
|
|
27
|
-
Wordmove::Actions::DeleteLocalFile.execute(
|
29
|
+
result = Wordmove::Actions::DeleteLocalFile.execute(
|
28
30
|
logger: context.logger,
|
29
31
|
cli_options: context.cli_options,
|
30
32
|
file_path: context.db_paths.local.path
|
31
33
|
)
|
34
|
+
if result.failure?
|
35
|
+
context.logger.warning 'Failed to delete local file ' \
|
36
|
+
"#{context.db_paths.local.path} because: " \
|
37
|
+
"#{result.message}" \
|
38
|
+
'. Manual intervention required'
|
39
|
+
end
|
32
40
|
|
33
|
-
Wordmove::Actions::DeleteLocalFile.execute(
|
41
|
+
result = Wordmove::Actions::DeleteLocalFile.execute(
|
34
42
|
cli_options: context.cli_options,
|
35
43
|
logger: context.logger,
|
36
44
|
file_path: context.db_paths.local.gzipped_adapted_path
|
37
45
|
)
|
46
|
+
if result.failure?
|
47
|
+
context.logger.warning 'Failed to delete local file ' \
|
48
|
+
"#{context.db_paths.local.gzipped_adapted_path} because: " \
|
49
|
+
"#{result.message}" \
|
50
|
+
'. Manual intervention required'
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
end
|
@@ -24,6 +24,8 @@ 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
|
+
|
27
29
|
context.logger.task 'Download remote DB'
|
28
30
|
|
29
31
|
next context if simulate?(cli_options: context.cli_options)
|
@@ -24,6 +24,8 @@ 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
|
+
|
27
29
|
context.logger.task 'Upload and import adapted DB'
|
28
30
|
|
29
31
|
result = Wordmove::Actions::PutFile.execute(
|
@@ -62,7 +64,12 @@ module Wordmove
|
|
62
64
|
cli_options: context.cli_options,
|
63
65
|
remote_file: context.db_paths.remote.path
|
64
66
|
)
|
65
|
-
|
67
|
+
if result.failure?
|
68
|
+
context.logger.warning 'Failed to delete remote file ' \
|
69
|
+
"#{context.db_paths.remote.path} because: " \
|
70
|
+
"#{result.message}" \
|
71
|
+
'. Manual intervention required'
|
72
|
+
end
|
66
73
|
end
|
67
74
|
end
|
68
75
|
end
|
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: 6.0.0.alpha.
|
4
|
+
version: 6.0.0.alpha.2
|
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-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|