capistrano 3.0.0.pre14 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -0
- data/README.md +1 -1
- data/bin/cap +1 -1
- data/capistrano.gemspec +3 -0
- data/features/deploy.feature +52 -0
- data/features/installation.feature +16 -0
- data/features/remote_file_task.feature +14 -0
- data/features/step_definitions/assertions.rb +90 -0
- data/features/step_definitions/cap_commands.rb +8 -0
- data/features/step_definitions/setup.rb +25 -0
- data/features/support/env.rb +12 -0
- data/features/support/remote_command_helpers.rb +20 -0
- data/lib/Capfile +1 -0
- data/lib/capistrano.rb +0 -14
- data/lib/capistrano/all.rb +16 -0
- data/lib/capistrano/application.rb +1 -10
- data/lib/capistrano/configuration.rb +4 -0
- data/lib/capistrano/configuration/server.rb +44 -6
- data/lib/capistrano/configuration/servers.rb +14 -51
- data/lib/capistrano/configuration/servers/role_filter.rb +86 -0
- data/lib/capistrano/defaults.rb +0 -8
- data/lib/capistrano/dsl.rb +1 -1
- data/lib/capistrano/dsl/env.rb +6 -2
- data/lib/capistrano/dsl/paths.rb +7 -4
- data/lib/capistrano/dsl/task_enhancements.rb +38 -0
- data/lib/capistrano/hg.rb +1 -0
- data/lib/capistrano/i18n.rb +1 -1
- data/lib/capistrano/setup.rb +7 -3
- data/lib/capistrano/tasks/deploy.rake +39 -9
- data/lib/capistrano/tasks/framework.rake +0 -2
- data/lib/capistrano/tasks/git.rake +3 -6
- data/lib/capistrano/tasks/hg.rake +39 -0
- data/lib/capistrano/templates/Capfile +2 -23
- data/lib/capistrano/templates/deploy.rb.erb +23 -0
- data/lib/capistrano/templates/stage.rb.erb +1 -1
- data/lib/capistrano/version.rb +1 -1
- data/spec/integration/dsl_spec.rb +71 -0
- data/spec/lib/capistrano/configuration/server_spec.rb +69 -0
- data/spec/lib/capistrano/configuration/servers/role_filter_spec.rb +140 -0
- data/spec/lib/capistrano/configuration/servers_spec.rb +46 -9
- data/spec/lib/capistrano/configuration_spec.rb +11 -0
- data/spec/spec_helper.rb +1 -2
- data/spec/support/.gitignore +1 -0
- data/spec/support/Vagrantfile +13 -0
- data/spec/support/tasks/database.cap +11 -0
- data/spec/support/test_app.rb +55 -6
- metadata +74 -16
- data/lib/capistrano/bundler.rb +0 -1
- data/lib/capistrano/tasks/bundler.rake +0 -13
- data/spec/integration/deploy_finalize_spec.rb +0 -34
- data/spec/integration/deploy_finished_spec.rb +0 -36
- data/spec/integration/deploy_started_spec.rb +0 -74
- data/spec/integration/deploy_update_spec.rb +0 -45
- data/spec/integration/installation_spec.rb +0 -76
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe 'cap deploy:updating', slow: true do
|
4
|
-
before do
|
5
|
-
install_test_app_with(config)
|
6
|
-
end
|
7
|
-
|
8
|
-
describe 'deploy' do
|
9
|
-
let(:config) {
|
10
|
-
%{
|
11
|
-
set :stage, :#{stage}
|
12
|
-
set :deploy_to, '#{deploy_to}'
|
13
|
-
set :repo_url, 'git://github.com/capistrano/capistrano.git'
|
14
|
-
set :branch, 'v3'
|
15
|
-
server 'localhost', roles: %w{web app}, user: '#{current_user}'
|
16
|
-
set :linked_files, %w{config/database.yml}
|
17
|
-
set :linked_dirs, %w{bin log public/system vendor/bundle}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
describe 'symlink' do
|
22
|
-
before do
|
23
|
-
cap 'deploy:started'
|
24
|
-
create_shared_directory('config')
|
25
|
-
create_shared_file('config/database.yml')
|
26
|
-
cap 'deploy:symlink:shared'
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'linked_dirs' do
|
30
|
-
it 'symlinks the directories in shared to `current`' do
|
31
|
-
%w{bin log public/system vendor/bundle}.each do |dir|
|
32
|
-
expect(release_path.join(dir)).to be_a_symlink_to shared_path.join(dir)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe 'linked_files' do
|
38
|
-
it 'symlinks the files in shared to `current`' do
|
39
|
-
file = 'config/database.yml'
|
40
|
-
expect(release_path.join(file)).to be_a_symlink_to shared_path.join(file)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe 'cap install' do
|
4
|
-
|
5
|
-
context 'with defaults' do
|
6
|
-
before :all do
|
7
|
-
create_test_app
|
8
|
-
Dir.chdir(test_app_path) do
|
9
|
-
%x[bundle exec cap install]
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'installation' do
|
14
|
-
|
15
|
-
it 'creates config/deploy' do
|
16
|
-
path = test_app_path.join('config/deploy')
|
17
|
-
expect(Dir.exists?(path)).to be_true
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'creates lib/capistrano/tasks' do
|
21
|
-
path = test_app_path.join('lib/capistrano/tasks')
|
22
|
-
expect(Dir.exists?(path)).to be_true
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'creates the deploy file' do
|
26
|
-
file = test_app_path.join('config/deploy.rb')
|
27
|
-
expect(File.exists?(file)).to be_true
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'creates the stage files' do
|
31
|
-
staging = test_app_path.join('config/deploy/staging.rb')
|
32
|
-
production = test_app_path.join('config/deploy/production.rb')
|
33
|
-
expect(File.exists?(staging)).to be_true
|
34
|
-
expect(File.exists?(production)).to be_true
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'with STAGES' do
|
41
|
-
before :all do
|
42
|
-
create_test_app
|
43
|
-
Dir.chdir(test_app_path) do
|
44
|
-
%x[bundle exec cap install STAGES=qa,production]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'installation' do
|
49
|
-
|
50
|
-
it 'creates config/deploy' do
|
51
|
-
path = test_app_path.join('config/deploy')
|
52
|
-
expect(Dir.exists?(path)).to be_true
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'creates lib/capistrano/tasks' do
|
56
|
-
path = test_app_path.join('lib/capistrano/tasks')
|
57
|
-
expect(Dir.exists?(path)).to be_true
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'creates the deploy file' do
|
61
|
-
file = test_app_path.join('config/deploy.rb')
|
62
|
-
expect(File.exists?(file)).to be_true
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'creates the stage files specified, not the defaults' do
|
66
|
-
qa = test_app_path.join('config/deploy/qa.rb')
|
67
|
-
production = test_app_path.join('config/deploy/production.rb')
|
68
|
-
staging = test_app_path.join('config/deploy/staging.rb')
|
69
|
-
expect(File.exists?(qa)).to be_true
|
70
|
-
expect(File.exists?(production)).to be_true
|
71
|
-
expect(File.exists?(staging)).to be_false
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|