capistrano 3.4.0 → 3.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +129 -0
- data/.github/issue_template.md +19 -0
- data/.github/pull_request_template.md +22 -0
- data/.github/release-drafter.yml +17 -0
- data/.github/workflows/push.yml +12 -0
- data/.gitignore +8 -5
- data/.rubocop.yml +62 -0
- data/CHANGELOG.md +1 -307
- data/CONTRIBUTING.md +63 -93
- data/DEVELOPMENT.md +127 -0
- data/Dangerfile +1 -0
- data/Gemfile +40 -3
- data/LICENSE.txt +1 -1
- data/README.md +127 -44
- data/RELEASING.md +17 -0
- data/Rakefile +13 -2
- data/UPGRADING-3.7.md +86 -0
- data/bin/cap +1 -1
- data/capistrano.gemspec +21 -24
- data/features/deploy.feature +35 -1
- data/features/doctor.feature +11 -0
- data/features/installation.feature +8 -3
- data/features/stage_failure.feature +9 -0
- data/features/step_definitions/assertions.rb +51 -18
- data/features/step_definitions/cap_commands.rb +9 -0
- data/features/step_definitions/setup.rb +53 -9
- data/features/subdirectory.feature +9 -0
- data/features/support/env.rb +5 -5
- data/features/support/remote_command_helpers.rb +12 -6
- data/features/support/vagrant_helpers.rb +17 -11
- data/lib/Capfile +1 -1
- data/lib/capistrano/all.rb +10 -10
- data/lib/capistrano/application.rb +47 -34
- data/lib/capistrano/configuration/empty_filter.rb +9 -0
- data/lib/capistrano/configuration/filter.rb +17 -47
- data/lib/capistrano/configuration/host_filter.rb +29 -0
- data/lib/capistrano/configuration/null_filter.rb +9 -0
- data/lib/capistrano/configuration/plugin_installer.rb +51 -0
- data/lib/capistrano/configuration/question.rb +31 -9
- data/lib/capistrano/configuration/role_filter.rb +29 -0
- data/lib/capistrano/configuration/scm_resolver.rb +149 -0
- data/lib/capistrano/configuration/server.rb +29 -23
- data/lib/capistrano/configuration/servers.rb +21 -14
- data/lib/capistrano/configuration/validated_variables.rb +110 -0
- data/lib/capistrano/configuration/variables.rb +112 -0
- data/lib/capistrano/configuration.rb +91 -44
- data/lib/capistrano/defaults.rb +26 -4
- data/lib/capistrano/deploy.rb +1 -1
- data/lib/capistrano/doctor/environment_doctor.rb +19 -0
- data/lib/capistrano/doctor/gems_doctor.rb +45 -0
- data/lib/capistrano/doctor/output_helpers.rb +79 -0
- data/lib/capistrano/doctor/servers_doctor.rb +105 -0
- data/lib/capistrano/doctor/variables_doctor.rb +74 -0
- data/lib/capistrano/doctor.rb +6 -0
- data/lib/capistrano/dotfile.rb +1 -2
- data/lib/capistrano/dsl/env.rb +9 -47
- data/lib/capistrano/dsl/paths.rb +11 -25
- data/lib/capistrano/dsl/stages.rb +14 -2
- data/lib/capistrano/dsl/task_enhancements.rb +7 -12
- data/lib/capistrano/dsl.rb +47 -16
- data/lib/capistrano/framework.rb +1 -1
- data/lib/capistrano/i18n.rb +32 -24
- data/lib/capistrano/immutable_task.rb +30 -0
- data/lib/capistrano/install.rb +1 -1
- data/lib/capistrano/plugin.rb +95 -0
- data/lib/capistrano/proc_helpers.rb +13 -0
- data/lib/capistrano/scm/git.rb +100 -0
- data/lib/capistrano/scm/hg.rb +55 -0
- data/lib/capistrano/scm/plugin.rb +13 -0
- data/lib/capistrano/scm/svn.rb +56 -0
- data/lib/capistrano/scm/tasks/git.rake +73 -0
- data/lib/capistrano/scm/tasks/hg.rake +53 -0
- data/lib/capistrano/scm/tasks/svn.rake +53 -0
- data/lib/capistrano/scm.rb +7 -20
- data/lib/capistrano/setup.rb +20 -6
- data/lib/capistrano/tasks/console.rake +4 -8
- data/lib/capistrano/tasks/deploy.rake +105 -73
- data/lib/capistrano/tasks/doctor.rake +24 -0
- data/lib/capistrano/tasks/framework.rake +13 -14
- data/lib/capistrano/tasks/install.rake +14 -15
- data/lib/capistrano/templates/Capfile +21 -10
- data/lib/capistrano/templates/deploy.rb.erb +17 -26
- data/lib/capistrano/templates/stage.rb.erb +9 -9
- data/lib/capistrano/upload_task.rb +1 -1
- data/lib/capistrano/version.rb +1 -1
- data/lib/capistrano/version_validator.rb +5 -10
- data/spec/integration/dsl_spec.rb +289 -240
- data/spec/integration_spec_helper.rb +3 -5
- data/spec/lib/capistrano/application_spec.rb +23 -39
- data/spec/lib/capistrano/configuration/empty_filter_spec.rb +17 -0
- data/spec/lib/capistrano/configuration/filter_spec.rb +83 -85
- data/spec/lib/capistrano/configuration/host_filter_spec.rb +71 -0
- data/spec/lib/capistrano/configuration/null_filter_spec.rb +17 -0
- data/spec/lib/capistrano/configuration/plugin_installer_spec.rb +98 -0
- data/spec/lib/capistrano/configuration/question_spec.rb +58 -26
- data/spec/lib/capistrano/configuration/role_filter_spec.rb +80 -0
- data/spec/lib/capistrano/configuration/scm_resolver_spec.rb +55 -0
- data/spec/lib/capistrano/configuration/server_spec.rb +106 -113
- data/spec/lib/capistrano/configuration/servers_spec.rb +129 -145
- data/spec/lib/capistrano/configuration_spec.rb +224 -63
- data/spec/lib/capistrano/doctor/environment_doctor_spec.rb +44 -0
- data/spec/lib/capistrano/doctor/gems_doctor_spec.rb +67 -0
- data/spec/lib/capistrano/doctor/output_helpers_spec.rb +47 -0
- data/spec/lib/capistrano/doctor/servers_doctor_spec.rb +86 -0
- data/spec/lib/capistrano/doctor/variables_doctor_spec.rb +89 -0
- data/spec/lib/capistrano/dsl/paths_spec.rb +97 -59
- data/spec/lib/capistrano/dsl/task_enhancements_spec.rb +57 -37
- data/spec/lib/capistrano/dsl_spec.rb +84 -11
- data/spec/lib/capistrano/immutable_task_spec.rb +31 -0
- data/spec/lib/capistrano/plugin_spec.rb +84 -0
- data/spec/lib/capistrano/scm/git_spec.rb +184 -0
- data/spec/lib/capistrano/scm/hg_spec.rb +109 -0
- data/spec/lib/capistrano/scm/svn_spec.rb +137 -0
- data/spec/lib/capistrano/scm_spec.rb +7 -8
- data/spec/lib/capistrano/upload_task_spec.rb +7 -7
- data/spec/lib/capistrano/version_validator_spec.rb +61 -46
- data/spec/lib/capistrano_spec.rb +2 -3
- data/spec/spec_helper.rb +21 -8
- data/spec/support/Vagrantfile +9 -10
- data/spec/support/tasks/database.rake +3 -3
- data/spec/support/tasks/fail.rake +4 -3
- data/spec/support/tasks/failed.rake +2 -2
- data/spec/support/tasks/plugin.rake +6 -0
- data/spec/support/tasks/root.rake +4 -4
- data/spec/support/test_app.rb +64 -39
- metadata +100 -55
- data/.travis.yml +0 -13
- data/features/remote_file_task.feature +0 -14
- data/lib/capistrano/git.rb +0 -46
- data/lib/capistrano/hg.rb +0 -43
- data/lib/capistrano/svn.rb +0 -38
- data/lib/capistrano/tasks/git.rake +0 -81
- data/lib/capistrano/tasks/hg.rake +0 -52
- data/lib/capistrano/tasks/svn.rake +0 -52
- data/spec/lib/capistrano/git_spec.rb +0 -81
- data/spec/lib/capistrano/hg_spec.rb +0 -81
- data/spec/lib/capistrano/svn_spec.rb +0 -79
@@ -1,48 +1,39 @@
|
|
1
|
-
# config valid
|
2
|
-
lock
|
1
|
+
# config valid for current version and patch releases of Capistrano
|
2
|
+
lock "~> <%= Capistrano::VERSION %>"
|
3
3
|
|
4
|
-
set :application,
|
5
|
-
set :repo_url,
|
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,
|
11
|
+
# set :deploy_to, "/var/www/my_app_name"
|
12
12
|
|
13
|
-
# Default value for :
|
14
|
-
# set :
|
13
|
+
# Default value for :format is :airbrussh.
|
14
|
+
# set :format, :airbrussh
|
15
15
|
|
16
|
-
#
|
17
|
-
#
|
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
|
-
#
|
24
|
+
# append :linked_files, "config/database.yml", 'config/master.key'
|
27
25
|
|
28
26
|
# Default value for linked_dirs is []
|
29
|
-
#
|
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
|
-
|
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
|
7
|
-
# server
|
8
|
-
# server
|
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
|
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/
|
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
|
53
|
-
# user:
|
52
|
+
# server "example.com",
|
53
|
+
# user: "user_name",
|
54
54
|
# roles: %w{web app},
|
55
55
|
# ssh_options: {
|
56
|
-
# user:
|
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:
|
60
|
+
# # password: "please use keys"
|
61
61
|
# }
|
data/lib/capistrano/version.rb
CHANGED
@@ -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
|
-
|
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(
|
25
|
+
Gem::Dependency.new("cap", version)
|
30
26
|
end
|
31
27
|
|
32
28
|
def requested
|
33
|
-
Gem::Dependency.new(
|
29
|
+
Gem::Dependency.new("cap", current_version)
|
34
30
|
end
|
35
|
-
|
36
31
|
end
|
37
32
|
end
|