capistrano 3.16.0 → 3.19.1
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.
- checksums.yaml +4 -4
- data/.docker/Dockerfile +7 -0
- data/.docker/ssh_key_rsa +49 -0
- data/.docker/ssh_key_rsa.pub +1 -0
- data/.docker/ubuntu_setup.sh +23 -0
- data/.github/release-drafter.yml +10 -2
- data/.github/workflows/ci.yml +80 -0
- data/.github/workflows/release-drafter.yml +18 -0
- data/.rubocop.yml +3 -3
- data/DEVELOPMENT.md +5 -20
- data/Gemfile +9 -4
- data/README.md +2 -2
- data/Rakefile +9 -6
- data/capistrano.gemspec +0 -4
- data/docker-compose.yml +8 -0
- data/features/deploy.feature +5 -1
- data/features/sshconnect.feature +1 -1
- data/features/step_definitions/assertions.rb +33 -23
- data/features/step_definitions/setup.rb +10 -13
- data/features/support/docker_gateway.rb +53 -0
- data/features/support/env.rb +0 -10
- data/features/support/remote_command_helpers.rb +3 -3
- data/features/support/remote_ssh_helpers.rb +33 -0
- data/lib/capistrano/configuration/validated_variables.rb +1 -1
- data/lib/capistrano/doctor/variables_doctor.rb +2 -0
- data/lib/capistrano/scm/git.rb +5 -0
- data/lib/capistrano/scm/tasks/git.rake +11 -0
- data/lib/capistrano/tasks/deploy.rake +23 -1
- data/lib/capistrano/templates/deploy.rb.erb +2 -2
- data/lib/capistrano/version.rb +1 -1
- data/spec/integration/dsl_spec.rb +11 -11
- data/spec/lib/capistrano/configuration/scm_resolver_spec.rb +1 -0
- data/spec/lib/capistrano/dsl_spec.rb +2 -2
- data/spec/lib/capistrano/scm/git_spec.rb +10 -0
- data/spec/support/test_app.rb +15 -11
- metadata +14 -54
- data/.github/workflows/push.yml +0 -12
- data/.travis.yml +0 -30
- data/Dangerfile +0 -1
- data/features/support/vagrant_helpers.rb +0 -41
- data/spec/support/.gitignore +0 -1
- data/spec/support/Vagrantfile +0 -23
@@ -0,0 +1,53 @@
|
|
1
|
+
# Ensure Docker container is completely stopped when Ruby exits.
|
2
|
+
at_exit do
|
3
|
+
DockerGateway.new.stop
|
4
|
+
end
|
5
|
+
|
6
|
+
# Manages the Docker-based SSH server that is declared in docker-compose.yml.
|
7
|
+
class DockerGateway
|
8
|
+
def initialize(log_proc=$stderr.method(:puts))
|
9
|
+
@log_proc = log_proc
|
10
|
+
end
|
11
|
+
|
12
|
+
def start
|
13
|
+
run_compose_command("up -d")
|
14
|
+
end
|
15
|
+
|
16
|
+
def stop
|
17
|
+
run_compose_command("down")
|
18
|
+
end
|
19
|
+
|
20
|
+
def run_shell_command(command)
|
21
|
+
run_compose_command("exec ssh_server /bin/bash -c #{command.shellescape}")
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def run_compose_command(command)
|
27
|
+
log "[docker compose] #{command}"
|
28
|
+
stdout, stderr, status = Open3.popen3("docker compose #{command}") do |stdin, stdout, stderr, wait_threads|
|
29
|
+
stdin << ""
|
30
|
+
stdin.close
|
31
|
+
out = Thread.new { read_lines(stdout, &$stdout.method(:puts)) }
|
32
|
+
err = Thread.new { stderr.read }
|
33
|
+
[out.value, err.value.to_s, wait_threads.value]
|
34
|
+
end
|
35
|
+
|
36
|
+
(stdout + stderr).each_line { |line| log "[docker compose] #{line}" }
|
37
|
+
|
38
|
+
[stdout, stderr, status]
|
39
|
+
end
|
40
|
+
|
41
|
+
def read_lines(io)
|
42
|
+
buffer = + ""
|
43
|
+
while (line = io.gets)
|
44
|
+
buffer << line
|
45
|
+
yield line
|
46
|
+
end
|
47
|
+
buffer
|
48
|
+
end
|
49
|
+
|
50
|
+
def log(message)
|
51
|
+
@log_proc.call(message)
|
52
|
+
end
|
53
|
+
end
|
data/features/support/env.rb
CHANGED
@@ -1,11 +1 @@
|
|
1
|
-
PROJECT_ROOT = File.expand_path("../../../", __FILE__)
|
2
|
-
VAGRANT_ROOT = File.join(PROJECT_ROOT, "spec/support")
|
3
|
-
VAGRANT_BIN = ENV["VAGRANT_BIN"] || "vagrant"
|
4
|
-
|
5
|
-
at_exit do
|
6
|
-
if ENV["KEEP_RUNNING"]
|
7
|
-
VagrantHelpers.run_vagrant_command("rm -rf /home/vagrant/var")
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
1
|
require_relative "../../spec/support/test_app"
|
@@ -12,7 +12,7 @@ module RemoteCommandHelpers
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def exists?(type, path)
|
15
|
-
%Q{[ -#{type} "#{path}" ]}
|
15
|
+
%Q{[[ -#{type} "#{path}" ]]}
|
16
16
|
end
|
17
17
|
|
18
18
|
def symlinked?(symlink_path, target_path)
|
@@ -20,9 +20,9 @@ module RemoteCommandHelpers
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def safely_remove_file(_path)
|
23
|
-
|
23
|
+
run_remote_ssh_command("rm #{test_file}")
|
24
24
|
rescue
|
25
|
-
|
25
|
+
RemoteSSHHelpers::RemoteSSHCommandError
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "open3"
|
2
|
+
require "socket"
|
3
|
+
require_relative "docker_gateway"
|
4
|
+
|
5
|
+
module RemoteSSHHelpers
|
6
|
+
extend self
|
7
|
+
|
8
|
+
class RemoteSSHCommandError < RuntimeError; end
|
9
|
+
|
10
|
+
def start_ssh_server
|
11
|
+
docker_gateway.start
|
12
|
+
end
|
13
|
+
|
14
|
+
def wait_for_ssh_server(retries=3)
|
15
|
+
Socket.tcp("localhost", 2022, connect_timeout: 1).close
|
16
|
+
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT
|
17
|
+
retries -= 1
|
18
|
+
sleep(2) && retry if retries.positive?
|
19
|
+
raise
|
20
|
+
end
|
21
|
+
|
22
|
+
def run_remote_ssh_command(command)
|
23
|
+
stdout, stderr, status = docker_gateway.run_shell_command(command)
|
24
|
+
return [stdout, stderr] if status.success?
|
25
|
+
raise RemoteSSHCommandError, status
|
26
|
+
end
|
27
|
+
|
28
|
+
def docker_gateway
|
29
|
+
@docker_gateway ||= DockerGateway.new(method(:log))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
World(RemoteSSHHelpers)
|
data/lib/capistrano/scm/git.rb
CHANGED
@@ -26,6 +26,7 @@ class Capistrano::SCM::Git < Capistrano::SCM::Plugin
|
|
26
26
|
after "deploy:new_release_path", "git:create_release"
|
27
27
|
before "deploy:check", "git:check"
|
28
28
|
before "deploy:set_current_revision", "git:set_current_revision"
|
29
|
+
before "deploy:set_current_revision_time", "git:set_current_revision_time"
|
29
30
|
end
|
30
31
|
|
31
32
|
def define_tasks
|
@@ -78,6 +79,10 @@ class Capistrano::SCM::Git < Capistrano::SCM::Plugin
|
|
78
79
|
backend.capture(:git, "rev-list --max-count=1 #{fetch(:branch)}")
|
79
80
|
end
|
80
81
|
|
82
|
+
def fetch_revision_time
|
83
|
+
backend.capture(:git, "--no-pager log -1 --pretty=format:\"%ct\" #{fetch(:branch)}")
|
84
|
+
end
|
85
|
+
|
81
86
|
def git(*args)
|
82
87
|
args.unshift :git
|
83
88
|
backend.execute(*args)
|
@@ -70,4 +70,15 @@ namespace :git do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
desc "Determine the unix timestamp that the revision that will be deployed was created"
|
75
|
+
task :set_current_revision_time do
|
76
|
+
on release_roles(:all), in: :groups, limit: fetch(:git_max_concurrent_connections), wait: fetch(:git_wait_interval) do
|
77
|
+
within repo_path do
|
78
|
+
with fetch(:git_environmental_variables) do
|
79
|
+
set :current_revision_time, git_plugin.fetch_revision_time
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
73
84
|
end
|
@@ -3,6 +3,7 @@ namespace :deploy do
|
|
3
3
|
invoke "deploy:print_config_variables" if fetch(:print_config_variables, false)
|
4
4
|
invoke "deploy:check"
|
5
5
|
invoke "deploy:set_previous_revision"
|
6
|
+
invoke "deploy:set_previous_revision_time"
|
6
7
|
end
|
7
8
|
|
8
9
|
task :print_config_variables do
|
@@ -27,6 +28,7 @@ namespace :deploy do
|
|
27
28
|
|
28
29
|
task updating: :new_release_path do
|
29
30
|
invoke "deploy:set_current_revision"
|
31
|
+
invoke "deploy:set_current_revision_time"
|
30
32
|
invoke "deploy:symlink:shared"
|
31
33
|
end
|
32
34
|
|
@@ -236,7 +238,7 @@ namespace :deploy do
|
|
236
238
|
end
|
237
239
|
|
238
240
|
desc "Place a REVISION file with the current revision SHA in the current release path"
|
239
|
-
task :set_current_revision
|
241
|
+
task :set_current_revision do
|
240
242
|
on release_roles(:all) do
|
241
243
|
within release_path do
|
242
244
|
execute :echo, "\"#{fetch(:current_revision)}\" > REVISION"
|
@@ -253,6 +255,26 @@ namespace :deploy do
|
|
253
255
|
end
|
254
256
|
end
|
255
257
|
|
258
|
+
desc "Place a REVISION_TIME file with the current revision commit time in the current release path"
|
259
|
+
task :set_current_revision_time do
|
260
|
+
on release_roles(:all) do
|
261
|
+
within release_path do
|
262
|
+
if fetch(:current_revision_time)
|
263
|
+
execute :echo, "\"#{fetch(:current_revision_time)}\" > REVISION_TIME"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
task :set_previous_revision_time do
|
270
|
+
on release_roles(:all) do
|
271
|
+
target = release_path.join("REVISION_TIME")
|
272
|
+
if test "[ -f #{target} ]"
|
273
|
+
set(:previous_revision_time, capture(:cat, target, "2>/dev/null"))
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
256
278
|
task :restart
|
257
279
|
task :failed
|
258
280
|
end
|
@@ -21,10 +21,10 @@ set :repo_url, "git@example.com:me/my_repo.git"
|
|
21
21
|
# set :pty, true
|
22
22
|
|
23
23
|
# Default value for :linked_files is []
|
24
|
-
# append :linked_files, "config/database.yml"
|
24
|
+
# append :linked_files, "config/database.yml", 'config/master.key'
|
25
25
|
|
26
26
|
# Default value for linked_dirs is []
|
27
|
-
# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
|
27
|
+
# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system", "vendor", "storage"
|
28
28
|
|
29
29
|
# Default value for default_env is {}
|
30
30
|
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
data/lib/capistrano/version.rb
CHANGED
@@ -247,7 +247,7 @@ describe Capistrano::DSL do
|
|
247
247
|
end
|
248
248
|
end
|
249
249
|
|
250
|
-
context "when the attribute `primary` is
|
250
|
+
context "when the attribute `primary` is explicitly set" do
|
251
251
|
subject { dsl.primary(:app) }
|
252
252
|
it "returns the servers" do
|
253
253
|
expect(subject.hostname).to eq "example4.com"
|
@@ -592,8 +592,8 @@ describe Capistrano::DSL do
|
|
592
592
|
|
593
593
|
it "yields the properties for a single role" do
|
594
594
|
recipient = mock("recipient")
|
595
|
-
recipient.expects(:doit).with("example1.com", :redis, port: 6379, type: :slave)
|
596
|
-
recipient.expects(:doit).with("example2.com", :redis, port: 6379, type: :master)
|
595
|
+
recipient.expects(:doit).with("example1.com", :redis, { port: 6379, type: :slave })
|
596
|
+
recipient.expects(:doit).with("example2.com", :redis, { port: 6379, type: :master })
|
597
597
|
dsl.role_properties(:redis) do |host, role, props|
|
598
598
|
recipient.doit(host, role, props)
|
599
599
|
end
|
@@ -601,8 +601,8 @@ describe Capistrano::DSL do
|
|
601
601
|
|
602
602
|
it "yields the properties for multiple roles" do
|
603
603
|
recipient = mock("recipient")
|
604
|
-
recipient.expects(:doit).with("example1.com", :redis, port: 6379, type: :slave)
|
605
|
-
recipient.expects(:doit).with("example2.com", :redis, port: 6379, type: :master)
|
604
|
+
recipient.expects(:doit).with("example1.com", :redis, { port: 6379, type: :slave })
|
605
|
+
recipient.expects(:doit).with("example2.com", :redis, { port: 6379, type: :master })
|
606
606
|
recipient.expects(:doit).with("example3.com", :app, nil)
|
607
607
|
dsl.role_properties(:redis, :app) do |host, role, props|
|
608
608
|
recipient.doit(host, role, props)
|
@@ -611,10 +611,10 @@ describe Capistrano::DSL do
|
|
611
611
|
|
612
612
|
it "yields the merged properties for multiple roles" do
|
613
613
|
recipient = mock("recipient")
|
614
|
-
recipient.expects(:doit).with("example1.com", :redis, port: 6379, type: :slave)
|
615
|
-
recipient.expects(:doit).with("example2.com", :redis, port: 6379, type: :master)
|
616
|
-
recipient.expects(:doit).with("example1.com", :web, port: 80)
|
617
|
-
recipient.expects(:doit).with("example2.com", :web, port: 81)
|
614
|
+
recipient.expects(:doit).with("example1.com", :redis, { port: 6379, type: :slave })
|
615
|
+
recipient.expects(:doit).with("example2.com", :redis, { port: 6379, type: :master })
|
616
|
+
recipient.expects(:doit).with("example1.com", :web, { port: 80 })
|
617
|
+
recipient.expects(:doit).with("example2.com", :web, { port: 81 })
|
618
618
|
dsl.role_properties(:redis, :web) do |host, role, props|
|
619
619
|
recipient.doit(host, role, props)
|
620
620
|
end
|
@@ -622,8 +622,8 @@ describe Capistrano::DSL do
|
|
622
622
|
|
623
623
|
it "honours a property filter before yielding" do
|
624
624
|
recipient = mock("recipient")
|
625
|
-
recipient.expects(:doit).with("example1.com", :redis, port: 6379, type: :slave)
|
626
|
-
recipient.expects(:doit).with("example1.com", :web, port: 80)
|
625
|
+
recipient.expects(:doit).with("example1.com", :redis, { port: 6379, type: :slave })
|
626
|
+
recipient.expects(:doit).with("example1.com", :web, { port: 80 })
|
627
627
|
dsl.role_properties(:redis, :web, select: :active) do |host, role, props|
|
628
628
|
recipient.doit(host, role, props)
|
629
629
|
end
|
@@ -12,6 +12,7 @@ module Capistrano
|
|
12
12
|
Rake::Task.define_task("deploy:check")
|
13
13
|
Rake::Task.define_task("deploy:new_release_path")
|
14
14
|
Rake::Task.define_task("deploy:set_current_revision")
|
15
|
+
Rake::Task.define_task("deploy:set_current_revision_time")
|
15
16
|
set :scm, SCMResolver::DEFAULT_GIT
|
16
17
|
end
|
17
18
|
|
@@ -72,7 +72,7 @@ module Capistrano
|
|
72
72
|
|
73
73
|
describe "#invoke" do
|
74
74
|
context "reinvoking" do
|
75
|
-
it "will not
|
75
|
+
it "will not re-enable invoking task", capture_io: true do
|
76
76
|
counter = 0
|
77
77
|
|
78
78
|
Rake::Task.define_task("A") do
|
@@ -98,7 +98,7 @@ module Capistrano
|
|
98
98
|
|
99
99
|
describe "#invoke!" do
|
100
100
|
context "reinvoking" do
|
101
|
-
it "will
|
101
|
+
it "will re-enable invoking task", capture_io: true do
|
102
102
|
counter = 0
|
103
103
|
|
104
104
|
Rake::Task.define_task("C") do
|
@@ -19,6 +19,7 @@ module Capistrano
|
|
19
19
|
Rake::Task.define_task("deploy:new_release_path")
|
20
20
|
Rake::Task.define_task("deploy:check")
|
21
21
|
Rake::Task.define_task("deploy:set_current_revision")
|
22
|
+
Rake::Task.define_task("deploy:set_current_revision_time")
|
22
23
|
end
|
23
24
|
|
24
25
|
# Clean up any tasks or variables that the plugin defined.
|
@@ -170,6 +171,15 @@ module Capistrano
|
|
170
171
|
end
|
171
172
|
end
|
172
173
|
|
174
|
+
describe "#fetch_revision_time" do
|
175
|
+
it "should capture git log without a pager" do
|
176
|
+
env.set(:branch, "branch")
|
177
|
+
backend.expects(:capture).with(:git, "--no-pager log -1 --pretty=format:\"%ct\" branch").returns("1715828406")
|
178
|
+
revision_time = subject.fetch_revision_time
|
179
|
+
expect(revision_time).to eq("1715828406")
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
173
183
|
describe "#verify_commit" do
|
174
184
|
it "should run git verify-commit" do
|
175
185
|
env.set(:branch, "branch")
|
data/spec/support/test_app.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "English"
|
2
2
|
require "fileutils"
|
3
3
|
require "pathname"
|
4
|
+
require "open3"
|
4
5
|
|
5
6
|
module TestApp
|
6
7
|
extend self
|
@@ -12,10 +13,10 @@ module TestApp
|
|
12
13
|
def default_config
|
13
14
|
<<-CONFIG
|
14
15
|
set :deploy_to, '#{deploy_to}'
|
15
|
-
set :repo_url, '
|
16
|
+
set :repo_url, 'https://github.com/capistrano/capistrano.git'
|
16
17
|
set :branch, 'master'
|
17
|
-
set :ssh_options, { keys:
|
18
|
-
server '
|
18
|
+
set :ssh_options, { keys: '#{File.expand_path('../../.docker/ssh_key_rsa', __dir__)}', auth_methods: ['publickey'] }
|
19
|
+
server 'deployer@localhost:2022', roles: %w{web app}
|
19
20
|
set :linked_files, #{linked_files}
|
20
21
|
set :linked_dirs, #{linked_dirs}
|
21
22
|
set :format_options, log_file: nil
|
@@ -39,9 +40,13 @@ module TestApp
|
|
39
40
|
FileUtils.rm_rf(test_app_path)
|
40
41
|
FileUtils.mkdir(test_app_path)
|
41
42
|
|
42
|
-
File.
|
43
|
-
|
44
|
-
|
43
|
+
File.write(gemfile, <<-GEMFILE.gsub(/^\s+/, ""))
|
44
|
+
source "https://rubygems.org"
|
45
|
+
|
46
|
+
gem "capistrano", path: #{path_to_cap.to_s.inspect}
|
47
|
+
gem "ed25519", ">= 1.2", "< 2.0"
|
48
|
+
gem "bcrypt_pbkdf", ">= 1.0", "< 2.0"
|
49
|
+
GEMFILE
|
45
50
|
|
46
51
|
Dir.chdir(test_app_path) do
|
47
52
|
run "bundle"
|
@@ -95,13 +100,12 @@ module TestApp
|
|
95
100
|
end
|
96
101
|
|
97
102
|
def run(command, subdirectory=nil)
|
98
|
-
output = nil
|
99
103
|
command = "bundle exec #{command}" unless command =~ /^bundle\b/
|
100
104
|
dir = subdirectory ? test_app_path.join(subdirectory) : test_app_path
|
101
|
-
Dir.chdir(dir) do
|
102
|
-
|
105
|
+
output, status = Dir.chdir(dir) do
|
106
|
+
with_clean_bundler_env { Open3.capture2e(command) }
|
103
107
|
end
|
104
|
-
[
|
108
|
+
[status.success?, output]
|
105
109
|
end
|
106
110
|
|
107
111
|
def stage
|
@@ -117,7 +121,7 @@ module TestApp
|
|
117
121
|
end
|
118
122
|
|
119
123
|
def deploy_to
|
120
|
-
Pathname.new("/home/
|
124
|
+
Pathname.new("/home/deployer/var/www/deploy")
|
121
125
|
end
|
122
126
|
|
123
127
|
def shared_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrussh
|
@@ -67,48 +67,6 @@ dependencies:
|
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 1.9.0
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: mocha
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: rspec
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '0'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: rubocop
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - '='
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: 0.48.1
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - '='
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: 0.48.1
|
112
70
|
description: Capistrano is a utility and framework for executing commands in parallel
|
113
71
|
on multiple remote machines, via SSH.
|
114
72
|
email:
|
@@ -120,17 +78,20 @@ executables:
|
|
120
78
|
extensions: []
|
121
79
|
extra_rdoc_files: []
|
122
80
|
files:
|
81
|
+
- ".docker/Dockerfile"
|
82
|
+
- ".docker/ssh_key_rsa"
|
83
|
+
- ".docker/ssh_key_rsa.pub"
|
84
|
+
- ".docker/ubuntu_setup.sh"
|
123
85
|
- ".github/issue_template.md"
|
124
86
|
- ".github/pull_request_template.md"
|
125
87
|
- ".github/release-drafter.yml"
|
126
|
-
- ".github/workflows/
|
88
|
+
- ".github/workflows/ci.yml"
|
89
|
+
- ".github/workflows/release-drafter.yml"
|
127
90
|
- ".gitignore"
|
128
91
|
- ".rubocop.yml"
|
129
|
-
- ".travis.yml"
|
130
92
|
- CHANGELOG.md
|
131
93
|
- CONTRIBUTING.md
|
132
94
|
- DEVELOPMENT.md
|
133
|
-
- Dangerfile
|
134
95
|
- Gemfile
|
135
96
|
- LICENSE.txt
|
136
97
|
- README.md
|
@@ -140,6 +101,7 @@ files:
|
|
140
101
|
- bin/cap
|
141
102
|
- bin/capify
|
142
103
|
- capistrano.gemspec
|
104
|
+
- docker-compose.yml
|
143
105
|
- features/configuration.feature
|
144
106
|
- features/deploy.feature
|
145
107
|
- features/deploy_failure.feature
|
@@ -151,9 +113,10 @@ files:
|
|
151
113
|
- features/step_definitions/cap_commands.rb
|
152
114
|
- features/step_definitions/setup.rb
|
153
115
|
- features/subdirectory.feature
|
116
|
+
- features/support/docker_gateway.rb
|
154
117
|
- features/support/env.rb
|
155
118
|
- features/support/remote_command_helpers.rb
|
156
|
-
- features/support/
|
119
|
+
- features/support/remote_ssh_helpers.rb
|
157
120
|
- lib/Capfile
|
158
121
|
- lib/capistrano.rb
|
159
122
|
- lib/capistrano/all.rb
|
@@ -244,8 +207,6 @@ files:
|
|
244
207
|
- spec/lib/capistrano/version_validator_spec.rb
|
245
208
|
- spec/lib/capistrano_spec.rb
|
246
209
|
- spec/spec_helper.rb
|
247
|
-
- spec/support/.gitignore
|
248
|
-
- spec/support/Vagrantfile
|
249
210
|
- spec/support/matchers.rb
|
250
211
|
- spec/support/tasks/database.rake
|
251
212
|
- spec/support/tasks/fail.rake
|
@@ -277,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
238
|
- !ruby/object:Gem::Version
|
278
239
|
version: '0'
|
279
240
|
requirements: []
|
280
|
-
rubygems_version: 3.
|
241
|
+
rubygems_version: 3.5.8
|
281
242
|
signing_key:
|
282
243
|
specification_version: 4
|
283
244
|
summary: Capistrano - Welcome to easy deployment with Ruby over SSH
|
@@ -293,9 +254,10 @@ test_files:
|
|
293
254
|
- features/step_definitions/cap_commands.rb
|
294
255
|
- features/step_definitions/setup.rb
|
295
256
|
- features/subdirectory.feature
|
257
|
+
- features/support/docker_gateway.rb
|
296
258
|
- features/support/env.rb
|
297
259
|
- features/support/remote_command_helpers.rb
|
298
|
-
- features/support/
|
260
|
+
- features/support/remote_ssh_helpers.rb
|
299
261
|
- spec/integration/dsl_spec.rb
|
300
262
|
- spec/integration_spec_helper.rb
|
301
263
|
- spec/lib/capistrano/application_spec.rb
|
@@ -328,8 +290,6 @@ test_files:
|
|
328
290
|
- spec/lib/capistrano/version_validator_spec.rb
|
329
291
|
- spec/lib/capistrano_spec.rb
|
330
292
|
- spec/spec_helper.rb
|
331
|
-
- spec/support/.gitignore
|
332
|
-
- spec/support/Vagrantfile
|
333
293
|
- spec/support/matchers.rb
|
334
294
|
- spec/support/tasks/database.rake
|
335
295
|
- spec/support/tasks/fail.rake
|
data/.github/workflows/push.yml
DELETED
data/.travis.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 3.0
|
4
|
-
- 2.7
|
5
|
-
- 2.6
|
6
|
-
- 2.5
|
7
|
-
- 2.4
|
8
|
-
- 2.3
|
9
|
-
- 2.2
|
10
|
-
- 2.1
|
11
|
-
- 2.0
|
12
|
-
matrix:
|
13
|
-
# Rubinius periodically fails in general, and it always segfaults for RuboCop
|
14
|
-
# in particular. Until we figure out how to make it work consistently, allow
|
15
|
-
# it to fail without breaking the build.
|
16
|
-
allow_failures:
|
17
|
-
- rvm: rbx-2
|
18
|
-
include:
|
19
|
-
- rvm: rbx-2
|
20
|
-
script: bundle exec rake spec
|
21
|
-
# Run Danger only once, on 2.5
|
22
|
-
- rvm: 2.5
|
23
|
-
before_script: bundle exec danger
|
24
|
-
|
25
|
-
script: bundle exec rake spec rubocop
|
26
|
-
install: bundle install --jobs=1
|
27
|
-
cache: bundler
|
28
|
-
branches:
|
29
|
-
only:
|
30
|
-
- master
|
data/Dangerfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
danger.import_dangerfile(github: "capistrano/danger", branch: "no-changelog")
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require "open3"
|
2
|
-
|
3
|
-
module VagrantHelpers
|
4
|
-
extend self
|
5
|
-
|
6
|
-
class VagrantSSHCommandError < RuntimeError; end
|
7
|
-
|
8
|
-
at_exit do
|
9
|
-
if ENV["KEEP_RUNNING"]
|
10
|
-
puts "Vagrant vm will be left up because KEEP_RUNNING is set."
|
11
|
-
puts "Rerun without KEEP_RUNNING set to cleanup the vm."
|
12
|
-
else
|
13
|
-
vagrant_cli_command("destroy -f")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def vagrant_cli_command(command)
|
18
|
-
puts "[vagrant] #{command}"
|
19
|
-
stdout, stderr, status = Dir.chdir(VAGRANT_ROOT) do
|
20
|
-
Open3.capture3("#{VAGRANT_BIN} #{command}")
|
21
|
-
end
|
22
|
-
|
23
|
-
(stdout + stderr).each_line { |line| puts "[vagrant] #{line}" }
|
24
|
-
|
25
|
-
[stdout, stderr, status]
|
26
|
-
end
|
27
|
-
|
28
|
-
def run_vagrant_command(command)
|
29
|
-
stdout, stderr, status = vagrant_cli_command("ssh -c #{command.inspect}")
|
30
|
-
return [stdout, stderr] if status.success?
|
31
|
-
raise VagrantSSHCommandError, status
|
32
|
-
end
|
33
|
-
|
34
|
-
def puts(message)
|
35
|
-
# Attach log messages to the current cucumber feature (`log`),
|
36
|
-
# or simply puts to the console (`super`) if we are outside of cucumber.
|
37
|
-
respond_to?(:log) ? log(message) : super(message)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
World(VagrantHelpers)
|
data/spec/support/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.vagrant
|