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,81 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'capistrano/git'
|
4
|
-
|
5
|
-
module Capistrano
|
6
|
-
describe Git do
|
7
|
-
let(:context) { Class.new.new }
|
8
|
-
subject { Capistrano::Git.new(context, Capistrano::Git::DefaultStrategy) }
|
9
|
-
|
10
|
-
describe "#git" do
|
11
|
-
it "should call execute git in the context, with arguments" do
|
12
|
-
context.expects(:execute).with(:git, :init)
|
13
|
-
subject.git(:init)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe Git::DefaultStrategy do
|
19
|
-
let(:context) { Class.new.new }
|
20
|
-
subject { Capistrano::Git.new(context, Capistrano::Git::DefaultStrategy) }
|
21
|
-
|
22
|
-
describe "#test" do
|
23
|
-
it "should call test for repo HEAD" do
|
24
|
-
context.expects(:repo_path).returns("/path/to/repo")
|
25
|
-
context.expects(:test).with " [ -f /path/to/repo/HEAD ] "
|
26
|
-
|
27
|
-
subject.test
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#check" do
|
32
|
-
it "should test the repo url" do
|
33
|
-
context.expects(:repo_url).returns(:url)
|
34
|
-
context.expects(:execute).with(:git, :'ls-remote --heads', :url).returns(true)
|
35
|
-
|
36
|
-
subject.check
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#clone" do
|
41
|
-
it "should run git clone" do
|
42
|
-
context.expects(:repo_url).returns(:url)
|
43
|
-
context.expects(:repo_path).returns(:path)
|
44
|
-
|
45
|
-
context.expects(:execute).with(:git, :clone, '--mirror', :url, :path)
|
46
|
-
|
47
|
-
subject.clone
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "#update" do
|
52
|
-
it "should run git update" do
|
53
|
-
context.expects(:execute).with(:git, :remote, :update)
|
54
|
-
|
55
|
-
subject.update
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "#release" do
|
60
|
-
it "should run git archive without a subtree" do
|
61
|
-
context.expects(:fetch).with(:repo_tree).returns(nil)
|
62
|
-
context.expects(:fetch).with(:branch).returns(:branch)
|
63
|
-
context.expects(:release_path).returns(:path)
|
64
|
-
|
65
|
-
context.expects(:execute).with(:git, :archive, :branch, '| tar -x -f - -C', :path)
|
66
|
-
|
67
|
-
subject.release
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should run git archive with a subtree" do
|
71
|
-
context.expects(:fetch).with(:repo_tree).returns('tree')
|
72
|
-
context.expects(:fetch).with(:branch).returns(:branch)
|
73
|
-
context.expects(:release_path).returns(:path)
|
74
|
-
|
75
|
-
context.expects(:execute).with(:git, :archive, :branch, 'tree', '| tar -x --strip-components 1 -f - -C', :path)
|
76
|
-
|
77
|
-
subject.release
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'capistrano/hg'
|
4
|
-
|
5
|
-
module Capistrano
|
6
|
-
describe Hg do
|
7
|
-
let(:context) { Class.new.new }
|
8
|
-
subject { Capistrano::Hg.new(context, Capistrano::Hg::DefaultStrategy) }
|
9
|
-
|
10
|
-
describe "#hg" do
|
11
|
-
it "should call execute hg in the context, with arguments" do
|
12
|
-
context.expects(:execute).with(:hg, :init)
|
13
|
-
subject.hg(:init)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe Hg::DefaultStrategy do
|
19
|
-
let(:context) { Class.new.new }
|
20
|
-
subject { Capistrano::Hg.new(context, Capistrano::Hg::DefaultStrategy) }
|
21
|
-
|
22
|
-
describe "#test" do
|
23
|
-
it "should call test for repo HEAD" do
|
24
|
-
context.expects(:repo_path).returns("/path/to/repo")
|
25
|
-
context.expects(:test).with " [ -d /path/to/repo/.hg ] "
|
26
|
-
|
27
|
-
subject.test
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#check" do
|
32
|
-
it "should test the repo url" do
|
33
|
-
context.expects(:repo_url).returns(:url)
|
34
|
-
context.expects(:execute).with(:hg, "id", :url)
|
35
|
-
|
36
|
-
subject.check
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#clone" do
|
41
|
-
it "should run hg clone" do
|
42
|
-
context.expects(:repo_url).returns(:url)
|
43
|
-
context.expects(:repo_path).returns(:path)
|
44
|
-
|
45
|
-
context.expects(:execute).with(:hg, "clone", '--noupdate', :url, :path)
|
46
|
-
|
47
|
-
subject.clone
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "#update" do
|
52
|
-
it "should run hg update" do
|
53
|
-
context.expects(:execute).with(:hg, "pull")
|
54
|
-
|
55
|
-
subject.update
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "#release" do
|
60
|
-
it "should run hg archive without a subtree" do
|
61
|
-
context.expects(:fetch).with(:repo_tree).returns(nil)
|
62
|
-
context.expects(:fetch).with(:branch).returns(:branch)
|
63
|
-
context.expects(:release_path).returns(:path)
|
64
|
-
|
65
|
-
context.expects(:execute).with(:hg, "archive", :path, "--rev", :branch)
|
66
|
-
|
67
|
-
subject.release
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should run hg archive with a subtree" do
|
71
|
-
context.expects(:fetch).with(:repo_tree).returns('tree')
|
72
|
-
context.expects(:fetch).with(:branch).returns(:branch)
|
73
|
-
context.expects(:release_path).returns(:path)
|
74
|
-
|
75
|
-
context.expects(:execute).with(:hg, "archive --type tgz -p . -I", 'tree', "--rev", :branch, '| tar -x --strip-components 1 -f - -C', :path)
|
76
|
-
|
77
|
-
subject.release
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'capistrano/svn'
|
4
|
-
|
5
|
-
module Capistrano
|
6
|
-
describe Svn do
|
7
|
-
let(:context) { Class.new.new }
|
8
|
-
subject { Capistrano::Svn.new(context, Capistrano::Svn::DefaultStrategy) }
|
9
|
-
|
10
|
-
describe "#svn" do
|
11
|
-
it "should call execute svn in the context, with arguments" do
|
12
|
-
context.expects(:execute).with(:svn, :init)
|
13
|
-
subject.svn(:init)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe Svn::DefaultStrategy do
|
19
|
-
let(:context) { Class.new.new }
|
20
|
-
subject { Capistrano::Svn.new(context, Capistrano::Svn::DefaultStrategy) }
|
21
|
-
|
22
|
-
describe "#test" do
|
23
|
-
it "should call test for repo HEAD" do
|
24
|
-
context.expects(:repo_path).returns("/path/to/repo")
|
25
|
-
context.expects(:test).with " [ -d /path/to/repo/.svn ] "
|
26
|
-
|
27
|
-
subject.test
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#check" do
|
32
|
-
it "should test the repo url" do
|
33
|
-
context.expects(:repo_url).returns(:url)
|
34
|
-
context.expects(:test).with(:svn, :info, :url).returns(true)
|
35
|
-
|
36
|
-
subject.check
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#clone" do
|
41
|
-
it "should run svn checkout" do
|
42
|
-
context.expects(:repo_url).returns(:url)
|
43
|
-
context.expects(:repo_path).returns(:path)
|
44
|
-
|
45
|
-
context.expects(:execute).with(:svn, :checkout, :url, :path)
|
46
|
-
|
47
|
-
subject.clone
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "#update" do
|
52
|
-
it "should run svn update" do
|
53
|
-
context.expects(:execute).with(:svn, :update)
|
54
|
-
|
55
|
-
subject.update
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "#release" do
|
60
|
-
it "should run svn export" do
|
61
|
-
context.expects(:release_path).returns(:path)
|
62
|
-
|
63
|
-
context.expects(:execute).with(:svn, :export, '--force', '.', :path)
|
64
|
-
|
65
|
-
subject.release
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe "#fetch_revision" do
|
70
|
-
it "should run fetch revision" do
|
71
|
-
context.expects(:repo_path).returns(:path)
|
72
|
-
|
73
|
-
context.expects(:capture).with(:svnversion, :path)
|
74
|
-
|
75
|
-
subject.fetch_revision
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|