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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d9941b583c7efed07744b92745a92343597448609a3eaf744bda7c43f7c5c92
4
- data.tar.gz: ad6e8b8f4da9431749a763aa0f85a1747ae83ee976aaa2da1506181021a30530
3
+ metadata.gz: 6a182f54bea0a027d35316cdf368c0c3c98a706bdc3bfbc176190fb7928a98df
4
+ data.tar.gz: 21ad918da1375bff9004661fcc6f2a3a951fe075b2d9baa722230137d0df7648
5
5
  SHA512:
6
- metadata.gz: 428d6fb168d3b9fbd61d7b2ab378651f8e208437ca829fb9b8d8bb57fec59393a519339bfd4fa402f07020482a4ffd3374ca672b6f055f310201aa4176540f84
7
- data.tar.gz: 76443da36ac2d51c6af649abbcb6bbbc4f14af67dff363fb87369c6e3a825e35422dc4d28682dd53a4d0f1a7ae1ceaa4e2bc424d2908119028981351caa81f07
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 remote file ' \
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,7 +17,6 @@ module Wordmove
17
17
 
18
18
  executed do |context| # rubocop:disable Metrics/BlockLength
19
19
  if context.database_task == false
20
- context.skip_remaining!
21
20
  context.db_paths = false
22
21
  next context
23
22
  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
- context.fail!(result.message) if result.failure?
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
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = '6.0.0.alpha.1'.freeze
2
+ VERSION = '6.0.0.alpha.2'.freeze
3
3
  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: 6.0.0.alpha.1
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-26 00:00:00.000000000 Z
15
+ date: 2021-12-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport