dkdeploy-core 9.1.0 → 9.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -1
  3. data/.travis.yml +2 -1
  4. data/Berksfile +2 -0
  5. data/Berksfile.lock +36 -35
  6. data/CHANGELOG.md +55 -0
  7. data/CONTRIBUTORS.md +3 -0
  8. data/Gemfile +2 -0
  9. data/LICENSE +1 -1
  10. data/README.md +9 -10
  11. data/Rakefile +2 -0
  12. data/Vagrantfile +8 -7
  13. data/config/vm/cookbooks/dkdeploy-core/metadata.rb +4 -4
  14. data/config/vm/cookbooks/dkdeploy-core/recipes/default.rb +11 -13
  15. data/dkdeploy-core.gemspec +10 -8
  16. data/features/assets.feature +0 -1
  17. data/features/file_access.feature +2 -2
  18. data/features/mysql.feature +2 -2
  19. data/features/support/env.rb +4 -2
  20. data/features/utils.feature +3 -3
  21. data/lib/capistrano/dkdeploy/core.rb +14 -17
  22. data/lib/dkdeploy.rb +2 -0
  23. data/lib/dkdeploy/constants.rb +2 -0
  24. data/lib/dkdeploy/core/version.rb +4 -2
  25. data/lib/dkdeploy/dsl.rb +2 -0
  26. data/lib/dkdeploy/helpers/assets.rb +2 -0
  27. data/lib/dkdeploy/helpers/common.rb +2 -0
  28. data/lib/dkdeploy/helpers/db.rb +7 -5
  29. data/lib/dkdeploy/helpers/file_system.rb +7 -12
  30. data/lib/dkdeploy/helpers/mysql.rb +3 -0
  31. data/lib/dkdeploy/i18n.rb +3 -12
  32. data/lib/dkdeploy/interaction_handler/mysql.rb +4 -1
  33. data/lib/dkdeploy/interaction_handler/password.rb +3 -1
  34. data/lib/dkdeploy/rollback_manager.rb +2 -0
  35. data/lib/dkdeploy/scm/copy.rake +3 -1
  36. data/lib/dkdeploy/scm/copy.rb +4 -2
  37. data/lib/dkdeploy/tasks/apache.rake +2 -0
  38. data/lib/dkdeploy/tasks/assets.rake +3 -1
  39. data/lib/dkdeploy/tasks/current_folder.rake +3 -1
  40. data/lib/dkdeploy/tasks/db.rake +9 -8
  41. data/lib/dkdeploy/tasks/deploy.rake +3 -0
  42. data/lib/dkdeploy/tasks/enhanced_symlinks.rake +7 -0
  43. data/lib/dkdeploy/tasks/fail.rake +2 -0
  44. data/lib/dkdeploy/tasks/file_access.rake +2 -0
  45. data/lib/dkdeploy/tasks/maintenance.rake +4 -2
  46. data/lib/dkdeploy/tasks/mysql.rake +5 -0
  47. data/lib/dkdeploy/tasks/project_version.rake +3 -3
  48. data/lib/dkdeploy/tasks/utils.rake +2 -0
  49. data/spec/fixtures/application/Capfile +2 -0
  50. data/spec/fixtures/application/Gemfile +3 -1
  51. data/spec/fixtures/application/config/deploy.rb +4 -0
  52. data/spec/fixtures/application/config/deploy/dev.rb +3 -1
  53. data/spec/fixtures/capistrano/configuration/add_output_after_create_symlink.rb +1 -0
  54. data/spec/fixtures/capistrano/configuration/custom_compass_sources.rb +2 -0
  55. data/spec/fixtures/capistrano/configuration/custom_file_access.rb +2 -0
  56. data/spec/fixtures/capistrano/configuration/default_deployment_behaviour.rb +2 -0
  57. metadata +38 -44
  58. data/features/bower.feature +0 -52
  59. data/lib/dkdeploy/tasks/bower.rake +0 -53
  60. data/spec/fixtures/application/htdocs/bower.json +0 -15
@@ -10,14 +10,14 @@ Feature: Test tasks for namespace 'mysql'
10
10
  And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
11
11
  And I successfully run `cap dev db:download_content`
12
12
  And I successfully run `cap dev mysql:download_slow_log`
13
- Then a file named "temp/slow-queries.dev.dkdeploy-core.dev.log" should exist
13
+ Then a file named "temp/slow-queries.dev.dkdeploy-core.test.log" should exist
14
14
 
15
15
  Scenario: Downloading the MYSQL slow log analyze file
16
16
  When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
17
17
  And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
18
18
  And I successfully run `cap dev db:download_content`
19
19
  And I successfully run `cap dev mysql:analyze_download_slow_log`
20
- Then a file named "temp/mysql_slow_log_analyze.dev.dkdeploy-core.dev.log" should exist
20
+ Then a file named "temp/mysql_slow_log_analyze.dev.dkdeploy-core.test.log" should exist
21
21
 
22
22
  Scenario: Clearing the MySQL slow log file
23
23
  When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dkdeploy/test_environment/application'
2
4
 
3
5
  ssh_config = {}
@@ -11,8 +13,8 @@ unless ssh_key_files.empty?
11
13
  }
12
14
  end
13
15
 
14
- TEST_APPLICATION = Dkdeploy::TestEnvironment::Application.new(File.expand_path('../../../', __FILE__), 'dkdeploy-core.dev', ssh_config)
15
- TEST_APPLICATION.mysql_connection_settings = { host: 'dkdeploy-core.dev', username: 'root', password: 'ilikerandompasswords' }
16
+ TEST_APPLICATION = Dkdeploy::TestEnvironment::Application.new(File.expand_path('../..', __dir__), 'dkdeploy-core.test', ssh_config)
17
+ TEST_APPLICATION.mysql_connection_settings = { host: 'dkdeploy-core.test', username: 'root', password: 'ilikerandompasswords' }
16
18
 
17
19
  # this configuration tricks Bundler into executing another Bundler project with clean enviroment
18
20
  # The official way via Bundler.with_clean_env did not work properly here
@@ -28,10 +28,10 @@ Feature: Test tasks for namespace 'utils'
28
28
  Remote file content
29
29
  """
30
30
  When I successfully run `cap dev utils:download_file['download_file.txt']`
31
- Then a file named "temp/download_file.dkdeploy-core.dev.txt" should exist
31
+ Then a file named "temp/download_file.dkdeploy-core.test.txt" should exist
32
32
 
33
33
  Scenario: Download a file from server which does exist locally
34
- Given a file named "temp/download_file.dkdeploy-core.dev.txt" with:
34
+ Given a file named "temp/download_file.dkdeploy-core.test.txt" with:
35
35
  """
36
36
  Local file content
37
37
  """
@@ -41,7 +41,7 @@ Local file content
41
41
  Remote file content
42
42
  """
43
43
  When I successfully run `cap dev utils:download_file['download_file.txt']`
44
- Then the file "temp/download_file.dkdeploy-core.dev.txt" should contain exactly:
44
+ Then the file "temp/download_file.dkdeploy-core.test.txt" should contain exactly:
45
45
  """
46
46
  Remote file content
47
47
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Capistrano::DSL
2
4
 
3
5
  require 'dkdeploy/rollback_manager'
@@ -7,19 +9,18 @@ require 'dkdeploy/scm/copy'
7
9
  install_plugin Dkdeploy::SCM::Copy
8
10
 
9
11
  # Load dkdeploy tasks
10
- load File.expand_path('../../../dkdeploy/tasks/deploy.rake', __FILE__)
11
- load File.expand_path('../../../dkdeploy/tasks/fail.rake', __FILE__)
12
- load File.expand_path('../../../dkdeploy/tasks/maintenance.rake', __FILE__)
13
- load File.expand_path('../../../dkdeploy/tasks/utils.rake', __FILE__)
14
- load File.expand_path('../../../dkdeploy/tasks/file_access.rake', __FILE__)
15
- load File.expand_path('../../../dkdeploy/tasks/assets.rake', __FILE__)
16
- load File.expand_path('../../../dkdeploy/tasks/apache.rake', __FILE__)
17
- load File.expand_path('../../../dkdeploy/tasks/project_version.rake', __FILE__)
18
- load File.expand_path('../../../dkdeploy/tasks/db.rake', __FILE__)
19
- load File.expand_path('../../../dkdeploy/tasks/enhanced_symlinks.rake', __FILE__)
20
- load File.expand_path('../../../dkdeploy/tasks/current_folder.rake', __FILE__)
21
- load File.expand_path('../../../dkdeploy/tasks/bower.rake', __FILE__)
22
- load File.expand_path('../../../dkdeploy/tasks/mysql.rake', __FILE__)
12
+ load File.expand_path('../../dkdeploy/tasks/deploy.rake', __dir__)
13
+ load File.expand_path('../../dkdeploy/tasks/fail.rake', __dir__)
14
+ load File.expand_path('../../dkdeploy/tasks/maintenance.rake', __dir__)
15
+ load File.expand_path('../../dkdeploy/tasks/utils.rake', __dir__)
16
+ load File.expand_path('../../dkdeploy/tasks/file_access.rake', __dir__)
17
+ load File.expand_path('../../dkdeploy/tasks/assets.rake', __dir__)
18
+ load File.expand_path('../../dkdeploy/tasks/apache.rake', __dir__)
19
+ load File.expand_path('../../dkdeploy/tasks/project_version.rake', __dir__)
20
+ load File.expand_path('../../dkdeploy/tasks/db.rake', __dir__)
21
+ load File.expand_path('../../dkdeploy/tasks/enhanced_symlinks.rake', __dir__)
22
+ load File.expand_path('../../dkdeploy/tasks/current_folder.rake', __dir__)
23
+ load File.expand_path('../../dkdeploy/tasks/mysql.rake', __dir__)
23
24
 
24
25
  # Hook into symlink related tasks
25
26
  after 'deploy:check:linked_dirs', 'deploy:enhanced_symlinks:check:linked_dirs'
@@ -56,10 +57,6 @@ namespace :load do
56
57
  # Number of archives to keep around
57
58
  set :keep_rollback_archives, 5
58
59
 
59
- # List of bower.json files
60
- set(:bower_path, -> { fetch(:copy_source) })
61
- set(:bower_paths, -> { Array(fetch(:copy_source)) })
62
-
63
60
  # List of filters for file_access:set_selected_custom_access
64
61
  set :selected_custom_file_access, []
65
62
 
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dkdeploy/core/version'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  # Global static methods
3
5
  #
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  module Core
3
5
  # Class for version number
4
6
  #
5
7
  class Version
6
8
  MAJOR = 9
7
- MINOR = 1
8
- PATCH = 0
9
+ MINOR = 2
10
+ PATCH = 4
9
11
 
10
12
  def self.to_s
11
13
  [MAJOR, MINOR, PATCH].join('.')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  # dsl api
3
5
  module DSL
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Capistrano::DSL
2
4
 
3
5
  module Dkdeploy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'highline'
2
4
 
3
5
  module Dkdeploy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  include Capistrano::DSL
@@ -7,7 +9,7 @@ module Dkdeploy
7
9
  # DB related helpers
8
10
  module DB
9
11
  def db_dump_file(infix = '')
10
- date = DateTime.now.strftime(datetime_format)
12
+ date = Time.now.strftime(datetime_format)
11
13
  ['database', fetch(:stage), infix, date].join('-') << '.sql'
12
14
  end
13
15
 
@@ -22,12 +24,12 @@ module Dkdeploy
22
24
  def db_settings_hash
23
25
  {
24
26
  'database' => {
25
- 'host' => fetch(:db_host),
26
- 'port' => fetch(:db_port),
27
- 'name' => fetch(:db_name),
27
+ 'host' => fetch(:db_host),
28
+ 'port' => fetch(:db_port),
29
+ 'name' => fetch(:db_name),
28
30
  'username' => fetch(:db_username),
29
31
  'password' => fetch(:db_password),
30
- 'charset' => fetch(:db_charset)
32
+ 'charset' => fetch(:db_charset)
31
33
  }
32
34
  }
33
35
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Capistrano::DSL
2
4
 
3
5
  module Dkdeploy
@@ -22,9 +24,8 @@ module Dkdeploy
22
24
  # @param path [String] path to resolve
23
25
  # @return [String]
24
26
  def resolve_path_if_symlink(context, path)
25
- if context.test " [ -L #{path} ] "
26
- return context.capture :readlink, '-f', path
27
- end
27
+ return context.capture :readlink, '-f', path if context.test " [ -L #{path} ] "
28
+
28
29
  path
29
30
  end
30
31
 
@@ -57,19 +58,13 @@ module Dkdeploy
57
58
  resolved_path = resolve_path_if_symlink(context, path)
58
59
 
59
60
  # change owner if set
60
- if access_properties.key?(:owner)
61
- context.execute :chown, recursive, access_properties.fetch(:owner), resolved_path
62
- end
61
+ context.execute :chown, recursive, access_properties.fetch(:owner), resolved_path if access_properties.key?(:owner)
63
62
 
64
63
  # change group if set
65
- if access_properties.key?(:group)
66
- context.execute :chgrp, recursive, access_properties.fetch(:group), resolved_path
67
- end
64
+ context.execute :chgrp, recursive, access_properties.fetch(:group), resolved_path if access_properties.key?(:group)
68
65
 
69
66
  # change mode if set
70
- if access_properties.key?(:mode) # rubocop:disable Style/GuardClause
71
- context.execute :chmod, recursive, access_properties.fetch(:mode), resolved_path
72
- end
67
+ context.execute :chmod, recursive, access_properties.fetch(:mode), resolved_path if access_properties.key?(:mode)
73
68
  end
74
69
  end
75
70
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Capistrano::DSL
2
4
 
3
5
  module Dkdeploy
@@ -9,6 +11,7 @@ module Dkdeploy
9
11
  # @return [Boolean]
10
12
  def slow_log_exists?(file_path)
11
13
  return true if !file_path.empty? && test("[ -f #{file_path} ]")
14
+
12
15
  error I18n.t('file.not_exists_or_not_accessible_on_host', file: file_path, host: server, scope: :dkdeploy)
13
16
  false
14
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
 
3
5
  en = {
@@ -42,11 +44,6 @@ en = {
42
44
  charset: 'Please enter the database character set',
43
45
  zipped_db_file: 'Please enter the name of the zipped SQL script file'
44
46
  },
45
- bower: {
46
- command: 'Please enter the command you want to run',
47
- path: 'Please enter the path to the bower.json file',
48
- paths: 'Please enter the paths bower.json files (separated by spaces)'
49
- },
50
47
  selected_custom_file_access: {
51
48
  paths: 'Please enter a list of paths (entries separated by spaces)'
52
49
  },
@@ -94,10 +91,6 @@ en = {
94
91
  upload_extract: 'Extracting %{file}',
95
92
  exclude_file_not_found: "No exclude file found. To use set variable 'assets_exclude_file'"
96
93
  },
97
- bower: {
98
- skipping_missing_directory: 'Skipping directory %{bower_path} because it does not exist.',
99
- skipping_directory_with_missing_bower_file: 'Skipping directory %{bower_path} because it does not contain a bower.json file.'
100
- },
101
94
  copy: {
102
95
  archive: {
103
96
  generate: 'Generating the tar archive.',
@@ -144,6 +137,4 @@ capistrano_i18n_overwritten = {
144
137
  I18n.backend.store_translations(:en, dkdeploy: en)
145
138
  I18n.backend.store_translations(:en, capistrano: capistrano_i18n_overwritten)
146
139
 
147
- if I18n.respond_to?(:enforce_available_locales=)
148
- I18n.enforce_available_locales = true
149
- end
140
+ I18n.enforce_available_locales = true if I18n.respond_to?(:enforce_available_locales=)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  module InteractionHandler
3
5
  # Interaction handler for mysql
@@ -26,8 +28,9 @@ module Dkdeploy
26
28
  else
27
29
  @mysql_error_seen = true if data =~ /.*ERROR.*/i
28
30
  return raise 'Unexpected data from stream. Can not send password to undefined stream' unless @mysql_error_seen
31
+
29
32
  # combine the multiple lines from error message. The fact that the error message will be shown multiple times is simply ignored
30
- @return_message << data
33
+ @return_message += data
31
34
  message = 'Error on executing MySQL command! Response (error code) is: '
32
35
  SSHKit.config.output.send(:error, "#{message}\n #{@return_message}")
33
36
  raise 'InteractionHandler caught a MySQL error'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  module InteractionHandler
3
5
  # Interaction handler for password
@@ -20,7 +22,7 @@ module Dkdeploy
20
22
  channel.send_data("#{@password}\n")
21
23
  else
22
24
  channel.close
23
- raise 'Unexpected data from stream. Can not send password to undefined stream'
25
+ raise 'Unexpected data from stream. Can not send password to undefined stream.'
24
26
  end
25
27
  end
26
28
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dkdeploy
2
4
  # The RollbackManager module is a mixin for managing rollback tasks.
3
5
  module RollbackManager
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :copy do
2
4
  desc 'Check if all configuration variables and copy sources exist'
3
5
  task :check do
@@ -62,7 +64,7 @@ namespace :copy do
62
64
  # removes the remote temp path including the uploaded archive
63
65
  on release_roles :all do
64
66
  info I18n.t('file.remove', path: remote_archive_path, scope: :dkdeploy)
65
- execute :rm, '-rf', remote_tmp_dir
67
+ execute :rm, '-rf', remote_archive_path
66
68
  end
67
69
  end
68
70
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tmpdir'
2
4
  require 'capistrano/scm/plugin'
3
5
  require 'capistrano/i18n'
@@ -25,7 +27,7 @@ module Dkdeploy
25
27
  'Thumbs.db',
26
28
  'composer.lock'
27
29
  ]
28
- set_if_empty :copy_archive_filename, -> { Dir::Tmpname.make_tmpname([fetch(:application) + '_', '.tar.gz'], nil) }
30
+ set_if_empty :copy_archive_filename, -> { [fetch(:application), rand(0x100000000).to_s(36)].join('_') + '.tar.gz' }
29
31
  set_if_empty :copy_local_tmp_dir, Dir.mktmpdir
30
32
  end
31
33
 
@@ -38,7 +40,7 @@ module Dkdeploy
38
40
  def define_tasks
39
41
  # Don not use method "eval_rakefile" to load rake tasks.
40
42
  # "eval_rakefile" defined wrong context and use sskit dsl api instead of capistrano dsl.
41
- load File.expand_path('../copy.rake', __FILE__)
43
+ load File.expand_path('copy.rake', __dir__)
42
44
  end
43
45
  end
44
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'erb'
2
4
  require 'capistrano/i18n'
3
5
  require 'dkdeploy/i18n'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
  require 'dkdeploy/i18n'
3
5
  require 'dkdeploy/helpers/common'
@@ -44,7 +46,7 @@ namespace :assets do
44
46
  on release_roles :web do
45
47
  info I18n.t('directory.create', scope: :dkdeploy)
46
48
  execute :mkdir, '-p', shared_path
47
- execute :htpasswd, '-c', htpasswd_path, username, interaction_handler: Dkdeploy::InteractionHandler::Password.new(password)
49
+ execute :htpasswd, '-c', htpasswd_path, username, interaction_handler: { /.*password.*/i => "#{password}\n" }
48
50
  info I18n.t('tasks.assets.add_htpasswd.successfully_created', scope: :dkdeploy)
49
51
  end
50
52
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Capistrano::DSL
2
4
 
3
5
  require 'dkdeploy/i18n'
@@ -6,7 +8,7 @@ namespace :current_folder do
6
8
  desc "Delete current folder unless it's a symlink"
7
9
  task :remove_unlesss_symlinked do
8
10
  on release_roles :all do
9
- if test "[[ -d #{current_path} && ! -L #{current_path} ]]"
11
+ if test "[ -d #{current_path} ] && [ ! -L #{current_path} ]"
10
12
  execute :rm, '-rf', current_path
11
13
  else
12
14
  info I18n.t('info.ignoring_current_folder', scope: :dkdeploy)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dkdeploy/constants'
2
4
  require 'dkdeploy/helpers/common'
3
5
  require 'dkdeploy/helpers/db'
@@ -115,7 +117,7 @@ namespace :db do
115
117
  execute :rm, '-f', remote_dump_file
116
118
  execute :rm, '-f', remote_zipped_dump_file
117
119
  execute :mysqldump,
118
- '--no-data', '--skip-set-charset',
120
+ '--no-data', '--skip-set-charset', '--no-tablespaces',
119
121
  "--default-character-set=#{db_settings.fetch('charset')}",
120
122
  '-u', db_settings.fetch('username'),
121
123
  '-p',
@@ -144,12 +146,13 @@ namespace :db do
144
146
  execute :rm, '-f', remote_zipped_dump_file
145
147
 
146
148
  ignore_tables_command_line = ignore_tables.inject('') do |command_line, table|
147
- command_line << " --ignore-table=#{db_settings.fetch('name')}.#{table}"
149
+ command_line + " --ignore-table=#{db_settings.fetch('name')}.#{table}"
148
150
  end
149
151
 
150
152
  execute :mysqldump,
151
153
  "--default-character-set=#{db_settings.fetch('charset')}",
152
154
  '--skip-set-charset',
155
+ '--no-tablespaces',
153
156
  '-u', db_settings.fetch('username'),
154
157
  '-p',
155
158
  '-h', db_settings.fetch('host'), '-P', db_settings.fetch('port'), ignore_tables_command_line, db_settings.fetch('name'),
@@ -179,7 +182,7 @@ namespace :db do
179
182
  execute :rm, '-f', remote_dump_file
180
183
  execute :rm, '-f', remote_zipped_dump_file
181
184
  execute :mysqldump,
182
- '--no-data', '--skip-set-charset',
185
+ '--no-data', '--skip-set-charset', '--no-tablespaces',
183
186
  "--default-character-set=#{db_settings.fetch('charset')}",
184
187
  '-u', db_settings.fetch('username'),
185
188
  '-p',
@@ -214,7 +217,7 @@ namespace :db do
214
217
  execute :rm, '-f', remote_file_name
215
218
  execute :rm, '-f', remote_zipped_file
216
219
  execute :mysqldump,
217
- '--no-data', '--skip-set-charset',
220
+ '--no-data', '--skip-set-charset', '--no-tablespaces',
218
221
  '--no-create-info', '--skip-comments',
219
222
  '--skip-extended-insert', '--skip-set-charset',
220
223
  "--default-character-set=#{db_settings.fetch('charset')}",
@@ -313,7 +316,7 @@ namespace :db do
313
316
  "--default-character-set=#{db_settings.fetch('charset')}",
314
317
  '--no-create-info', '--skip-comments',
315
318
  '--skip-extended-insert', '--skip-set-charset',
316
- '--complete-insert',
319
+ '--complete-insert', '--no-tablespaces',
317
320
  '-u', db_settings.fetch('username'),
318
321
  '-p',
319
322
  '-h', db_settings.fetch('host'), '-P', db_settings.fetch('port'),
@@ -363,9 +366,7 @@ namespace :db do
363
366
 
364
367
  remote_md5 = '' # to allow assignment in block and later comparison
365
368
  on primary :backend do
366
- if test("[ -f #{remote_dump_md5_file} ]")
367
- remote_md5 = capture("cat #{remote_dump_md5_file}")
368
- end
369
+ remote_md5 = capture("cat #{remote_dump_md5_file}") if test("[ -f #{remote_dump_md5_file} ]")
369
370
  end
370
371
 
371
372
  run_locally do