capistrano 3.4.0 → 3.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +129 -0
  3. data/.github/issue_template.md +19 -0
  4. data/.github/pull_request_template.md +22 -0
  5. data/.github/release-drafter.yml +17 -0
  6. data/.github/workflows/push.yml +12 -0
  7. data/.gitignore +8 -5
  8. data/.rubocop.yml +62 -0
  9. data/CHANGELOG.md +1 -307
  10. data/CONTRIBUTING.md +63 -93
  11. data/DEVELOPMENT.md +127 -0
  12. data/Dangerfile +1 -0
  13. data/Gemfile +40 -3
  14. data/LICENSE.txt +1 -1
  15. data/README.md +127 -44
  16. data/RELEASING.md +17 -0
  17. data/Rakefile +13 -2
  18. data/UPGRADING-3.7.md +86 -0
  19. data/bin/cap +1 -1
  20. data/capistrano.gemspec +21 -24
  21. data/features/deploy.feature +35 -1
  22. data/features/doctor.feature +11 -0
  23. data/features/installation.feature +8 -3
  24. data/features/stage_failure.feature +9 -0
  25. data/features/step_definitions/assertions.rb +51 -18
  26. data/features/step_definitions/cap_commands.rb +9 -0
  27. data/features/step_definitions/setup.rb +53 -9
  28. data/features/subdirectory.feature +9 -0
  29. data/features/support/env.rb +5 -5
  30. data/features/support/remote_command_helpers.rb +12 -6
  31. data/features/support/vagrant_helpers.rb +17 -11
  32. data/lib/Capfile +1 -1
  33. data/lib/capistrano/all.rb +10 -10
  34. data/lib/capistrano/application.rb +47 -34
  35. data/lib/capistrano/configuration/empty_filter.rb +9 -0
  36. data/lib/capistrano/configuration/filter.rb +17 -47
  37. data/lib/capistrano/configuration/host_filter.rb +29 -0
  38. data/lib/capistrano/configuration/null_filter.rb +9 -0
  39. data/lib/capistrano/configuration/plugin_installer.rb +51 -0
  40. data/lib/capistrano/configuration/question.rb +31 -9
  41. data/lib/capistrano/configuration/role_filter.rb +29 -0
  42. data/lib/capistrano/configuration/scm_resolver.rb +149 -0
  43. data/lib/capistrano/configuration/server.rb +29 -23
  44. data/lib/capistrano/configuration/servers.rb +21 -14
  45. data/lib/capistrano/configuration/validated_variables.rb +110 -0
  46. data/lib/capistrano/configuration/variables.rb +112 -0
  47. data/lib/capistrano/configuration.rb +91 -44
  48. data/lib/capistrano/defaults.rb +26 -4
  49. data/lib/capistrano/deploy.rb +1 -1
  50. data/lib/capistrano/doctor/environment_doctor.rb +19 -0
  51. data/lib/capistrano/doctor/gems_doctor.rb +45 -0
  52. data/lib/capistrano/doctor/output_helpers.rb +79 -0
  53. data/lib/capistrano/doctor/servers_doctor.rb +105 -0
  54. data/lib/capistrano/doctor/variables_doctor.rb +74 -0
  55. data/lib/capistrano/doctor.rb +6 -0
  56. data/lib/capistrano/dotfile.rb +1 -2
  57. data/lib/capistrano/dsl/env.rb +9 -47
  58. data/lib/capistrano/dsl/paths.rb +11 -25
  59. data/lib/capistrano/dsl/stages.rb +14 -2
  60. data/lib/capistrano/dsl/task_enhancements.rb +7 -12
  61. data/lib/capistrano/dsl.rb +47 -16
  62. data/lib/capistrano/framework.rb +1 -1
  63. data/lib/capistrano/i18n.rb +32 -24
  64. data/lib/capistrano/immutable_task.rb +30 -0
  65. data/lib/capistrano/install.rb +1 -1
  66. data/lib/capistrano/plugin.rb +95 -0
  67. data/lib/capistrano/proc_helpers.rb +13 -0
  68. data/lib/capistrano/scm/git.rb +100 -0
  69. data/lib/capistrano/scm/hg.rb +55 -0
  70. data/lib/capistrano/scm/plugin.rb +13 -0
  71. data/lib/capistrano/scm/svn.rb +56 -0
  72. data/lib/capistrano/scm/tasks/git.rake +73 -0
  73. data/lib/capistrano/scm/tasks/hg.rake +53 -0
  74. data/lib/capistrano/scm/tasks/svn.rake +53 -0
  75. data/lib/capistrano/scm.rb +7 -20
  76. data/lib/capistrano/setup.rb +20 -6
  77. data/lib/capistrano/tasks/console.rake +4 -8
  78. data/lib/capistrano/tasks/deploy.rake +105 -73
  79. data/lib/capistrano/tasks/doctor.rake +24 -0
  80. data/lib/capistrano/tasks/framework.rake +13 -14
  81. data/lib/capistrano/tasks/install.rake +14 -15
  82. data/lib/capistrano/templates/Capfile +21 -10
  83. data/lib/capistrano/templates/deploy.rb.erb +17 -26
  84. data/lib/capistrano/templates/stage.rb.erb +9 -9
  85. data/lib/capistrano/upload_task.rb +1 -1
  86. data/lib/capistrano/version.rb +1 -1
  87. data/lib/capistrano/version_validator.rb +5 -10
  88. data/spec/integration/dsl_spec.rb +289 -240
  89. data/spec/integration_spec_helper.rb +3 -5
  90. data/spec/lib/capistrano/application_spec.rb +23 -39
  91. data/spec/lib/capistrano/configuration/empty_filter_spec.rb +17 -0
  92. data/spec/lib/capistrano/configuration/filter_spec.rb +83 -85
  93. data/spec/lib/capistrano/configuration/host_filter_spec.rb +71 -0
  94. data/spec/lib/capistrano/configuration/null_filter_spec.rb +17 -0
  95. data/spec/lib/capistrano/configuration/plugin_installer_spec.rb +98 -0
  96. data/spec/lib/capistrano/configuration/question_spec.rb +58 -26
  97. data/spec/lib/capistrano/configuration/role_filter_spec.rb +80 -0
  98. data/spec/lib/capistrano/configuration/scm_resolver_spec.rb +55 -0
  99. data/spec/lib/capistrano/configuration/server_spec.rb +106 -113
  100. data/spec/lib/capistrano/configuration/servers_spec.rb +129 -145
  101. data/spec/lib/capistrano/configuration_spec.rb +224 -63
  102. data/spec/lib/capistrano/doctor/environment_doctor_spec.rb +44 -0
  103. data/spec/lib/capistrano/doctor/gems_doctor_spec.rb +67 -0
  104. data/spec/lib/capistrano/doctor/output_helpers_spec.rb +47 -0
  105. data/spec/lib/capistrano/doctor/servers_doctor_spec.rb +86 -0
  106. data/spec/lib/capistrano/doctor/variables_doctor_spec.rb +89 -0
  107. data/spec/lib/capistrano/dsl/paths_spec.rb +97 -59
  108. data/spec/lib/capistrano/dsl/task_enhancements_spec.rb +57 -37
  109. data/spec/lib/capistrano/dsl_spec.rb +84 -11
  110. data/spec/lib/capistrano/immutable_task_spec.rb +31 -0
  111. data/spec/lib/capistrano/plugin_spec.rb +84 -0
  112. data/spec/lib/capistrano/scm/git_spec.rb +184 -0
  113. data/spec/lib/capistrano/scm/hg_spec.rb +109 -0
  114. data/spec/lib/capistrano/scm/svn_spec.rb +137 -0
  115. data/spec/lib/capistrano/scm_spec.rb +7 -8
  116. data/spec/lib/capistrano/upload_task_spec.rb +7 -7
  117. data/spec/lib/capistrano/version_validator_spec.rb +61 -46
  118. data/spec/lib/capistrano_spec.rb +2 -3
  119. data/spec/spec_helper.rb +21 -8
  120. data/spec/support/Vagrantfile +9 -10
  121. data/spec/support/tasks/database.rake +3 -3
  122. data/spec/support/tasks/fail.rake +4 -3
  123. data/spec/support/tasks/failed.rake +2 -2
  124. data/spec/support/tasks/plugin.rake +6 -0
  125. data/spec/support/tasks/root.rake +4 -4
  126. data/spec/support/test_app.rb +64 -39
  127. metadata +100 -55
  128. data/.travis.yml +0 -13
  129. data/features/remote_file_task.feature +0 -14
  130. data/lib/capistrano/git.rb +0 -46
  131. data/lib/capistrano/hg.rb +0 -43
  132. data/lib/capistrano/svn.rb +0 -38
  133. data/lib/capistrano/tasks/git.rake +0 -81
  134. data/lib/capistrano/tasks/hg.rake +0 -52
  135. data/lib/capistrano/tasks/svn.rake +0 -52
  136. data/spec/lib/capistrano/git_spec.rb +0 -81
  137. data/spec/lib/capistrano/hg_spec.rb +0 -81
  138. data/spec/lib/capistrano/svn_spec.rb +0 -79
@@ -1,48 +1,39 @@
1
- # config valid only for current version of Capistrano
2
- lock '<%= Capistrano::VERSION %>'
1
+ # config valid for current version and patch releases of Capistrano
2
+ lock "~> <%= Capistrano::VERSION %>"
3
3
 
4
- set :application, 'my_app_name'
5
- set :repo_url, 'git@example.com:me/my_repo.git'
4
+ set :application, "my_app_name"
5
+ set :repo_url, "git@example.com:me/my_repo.git"
6
6
 
7
7
  # Default branch is :master
8
8
  # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
9
9
 
10
10
  # Default deploy_to directory is /var/www/my_app_name
11
- # set :deploy_to, '/var/www/my_app_name'
11
+ # set :deploy_to, "/var/www/my_app_name"
12
12
 
13
- # Default value for :scm is :git
14
- # set :scm, :git
13
+ # Default value for :format is :airbrussh.
14
+ # set :format, :airbrussh
15
15
 
16
- # Default value for :format is :pretty
17
- # set :format, :pretty
18
-
19
- # Default value for :log_level is :debug
20
- # set :log_level, :debug
16
+ # You can configure the Airbrussh format using :format_options.
17
+ # These are the defaults.
18
+ # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
21
19
 
22
20
  # Default value for :pty is false
23
21
  # set :pty, true
24
22
 
25
23
  # Default value for :linked_files is []
26
- # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
24
+ # append :linked_files, "config/database.yml", 'config/master.key'
27
25
 
28
26
  # Default value for linked_dirs is []
29
- # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
27
+ # append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "tmp/webpacker", "public/system", "vendor", "storage"
30
28
 
31
29
  # Default value for default_env is {}
32
30
  # set :default_env, { path: "/opt/ruby/bin:$PATH" }
33
31
 
32
+ # Default value for local_user is ENV['USER']
33
+ # set :local_user, -> { `git config user.name`.chomp }
34
+
34
35
  # Default value for keep_releases is 5
35
36
  # set :keep_releases, 5
36
37
 
37
- namespace :deploy do
38
-
39
- after :restart, :clear_cache do
40
- on roles(:web), in: :groups, limit: 3, wait: 10 do
41
- # Here we can do anything such as:
42
- # within release_path do
43
- # execute :rake, 'cache:clear'
44
- # end
45
- end
46
- end
47
-
48
- end
38
+ # Uncomment the following to require manually verifying the host key before first deploy.
39
+ # set :ssh_options, verify_host_key: :secure
@@ -3,9 +3,9 @@
3
3
  # Defines a single server with a list of roles and multiple properties.
4
4
  # You can define all roles on a single server, or split them:
5
5
 
6
- # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7
- # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8
- # server 'db.example.com', user: 'deploy', roles: %w{db}
6
+ # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value
7
+ # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
8
+ # server "db.example.com", user: "deploy", roles: %w{db}
9
9
 
10
10
 
11
11
 
@@ -13,7 +13,7 @@
13
13
  # ==================
14
14
 
15
15
  # Defines a role with one or multiple servers. The primary server in each
16
- # group is considered to be the first unless any hosts have the primary
16
+ # group is considered to be the first unless any hosts have the primary
17
17
  # property set. Specify the username and a domain or IP for the server.
18
18
  # Don't use `:all`, it's a meta role.
19
19
 
@@ -42,20 +42,20 @@
42
42
  # Global options
43
43
  # --------------
44
44
  # set :ssh_options, {
45
- # keys: %w(/home/rlisowski/.ssh/id_rsa),
45
+ # keys: %w(/home/user_name/.ssh/id_rsa),
46
46
  # forward_agent: false,
47
47
  # auth_methods: %w(password)
48
48
  # }
49
49
  #
50
50
  # The server-based syntax can be used to override options:
51
51
  # ------------------------------------
52
- # server 'example.com',
53
- # user: 'user_name',
52
+ # server "example.com",
53
+ # user: "user_name",
54
54
  # roles: %w{web app},
55
55
  # ssh_options: {
56
- # user: 'user_name', # overrides user setting above
56
+ # user: "user_name", # overrides user setting above
57
57
  # keys: %w(/home/user_name/.ssh/id_rsa),
58
58
  # forward_agent: false,
59
59
  # auth_methods: %w(publickey password)
60
- # # password: 'please use keys'
60
+ # # password: "please use keys"
61
61
  # }
@@ -1,4 +1,4 @@
1
- require 'rake/file_creation_task'
1
+ require "rake/file_creation_task"
2
2
 
3
3
  module Capistrano
4
4
  class UploadTask < Rake::FileCreationTask
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- VERSION = "3.4.0"
2
+ VERSION = "3.17.1".freeze
3
3
  end
@@ -1,21 +1,17 @@
1
1
  module Capistrano
2
2
  class VersionValidator
3
-
4
3
  def initialize(version)
5
4
  @version = version
6
5
  end
7
6
 
8
7
  def verify
9
- if match?
10
- self
11
- else
12
- fail "Capfile locked at #{version}, but #{current_version} is loaded"
13
- end
8
+ return self if match?
9
+ raise "Capfile locked at #{version}, but #{current_version} is loaded"
14
10
  end
15
11
 
16
12
  private
17
- attr_reader :version
18
13
 
14
+ attr_reader :version
19
15
 
20
16
  def match?
21
17
  available =~ requested
@@ -26,12 +22,11 @@ module Capistrano
26
22
  end
27
23
 
28
24
  def available
29
- Gem::Dependency.new('cap', version)
25
+ Gem::Dependency.new("cap", version)
30
26
  end
31
27
 
32
28
  def requested
33
- Gem::Dependency.new('cap', current_version)
29
+ Gem::Dependency.new("cap", current_version)
34
30
  end
35
-
36
31
  end
37
32
  end