capistrano 2.15.11 → 3.0.0.pre
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 +5 -5
- data/.gitignore +17 -8
- data/Gemfile +1 -12
- data/LICENSE.txt +18 -0
- data/README.md +65 -68
- data/Rakefile +4 -10
- data/bin/cap +2 -3
- data/bin/capify +7 -91
- data/capistrano.gemspec +20 -34
- data/lib/Capfile +2 -0
- data/lib/capistrano/application.rb +28 -0
- data/lib/capistrano/bundler.rb +1 -0
- data/lib/capistrano/configuration/question.rb +42 -0
- data/lib/capistrano/configuration/server.rb +24 -0
- data/lib/capistrano/configuration/servers.rb +43 -95
- data/lib/capistrano/configuration.rb +81 -44
- data/lib/capistrano/console.rb +1 -0
- data/lib/capistrano/defaults.rb +11 -0
- data/lib/capistrano/deploy.rb +3 -0
- data/lib/capistrano/dotfile.rb +3 -0
- data/lib/capistrano/dsl/env.rb +57 -0
- data/lib/capistrano/dsl/paths.rb +74 -0
- data/lib/capistrano/dsl/stages.rb +15 -0
- data/lib/capistrano/dsl/task_enhancements.rb +15 -0
- data/lib/capistrano/dsl.rb +38 -0
- data/lib/capistrano/git.rb +1 -0
- data/lib/capistrano/i18n.rb +33 -0
- data/lib/capistrano/install.rb +1 -0
- data/lib/capistrano/setup.rb +17 -0
- data/lib/capistrano/tasks/bundler.rake +13 -0
- data/lib/capistrano/tasks/console.rake +21 -0
- data/lib/capistrano/tasks/deploy.rake +153 -0
- data/lib/capistrano/tasks/framework.rake +45 -0
- data/lib/capistrano/tasks/git.rake +65 -0
- data/lib/capistrano/tasks/install.rake +39 -0
- data/lib/capistrano/templates/Capfile +43 -0
- data/lib/capistrano/templates/deploy.rb.erb +17 -0
- data/lib/capistrano/templates/stage.rb.erb +20 -0
- data/lib/capistrano/version.rb +1 -11
- data/lib/capistrano.rb +9 -3
- data/spec/lib/capistrano/configuration/question_spec.rb +54 -0
- data/spec/lib/capistrano/configuration/server_spec.rb +48 -0
- data/spec/lib/capistrano/configuration/servers_spec.rb +79 -0
- data/spec/lib/capistrano/configuration_spec.rb +80 -0
- data/spec/lib/capistrano/dsl/env_spec.rb +83 -0
- data/spec/lib/capistrano/dsl/paths_spec.rb +69 -0
- data/spec/lib/capistrano/dsl_spec.rb +51 -0
- data/spec/lib/capistrano_spec.rb +8 -0
- data/spec/spec_helper.rb +14 -0
- metadata +89 -215
- data/.travis.yml +0 -9
- data/CHANGELOG +0 -1203
- data/lib/capistrano/callback.rb +0 -45
- data/lib/capistrano/cli/execute.rb +0 -85
- data/lib/capistrano/cli/help.rb +0 -125
- data/lib/capistrano/cli/help.txt +0 -81
- data/lib/capistrano/cli/options.rb +0 -243
- data/lib/capistrano/cli/ui.rb +0 -40
- data/lib/capistrano/cli.rb +0 -47
- data/lib/capistrano/command.rb +0 -303
- data/lib/capistrano/configuration/actions/file_transfer.rb +0 -50
- data/lib/capistrano/configuration/actions/inspect.rb +0 -46
- data/lib/capistrano/configuration/actions/invocation.rb +0 -329
- data/lib/capistrano/configuration/alias_task.rb +0 -26
- data/lib/capistrano/configuration/callbacks.rb +0 -147
- data/lib/capistrano/configuration/connections.rb +0 -237
- data/lib/capistrano/configuration/execution.rb +0 -142
- data/lib/capistrano/configuration/loading.rb +0 -205
- data/lib/capistrano/configuration/log_formatters.rb +0 -75
- data/lib/capistrano/configuration/namespaces.rb +0 -223
- data/lib/capistrano/configuration/roles.rb +0 -83
- data/lib/capistrano/configuration/variables.rb +0 -127
- data/lib/capistrano/errors.rb +0 -19
- data/lib/capistrano/ext/multistage.rb +0 -67
- data/lib/capistrano/ext/string.rb +0 -5
- data/lib/capistrano/extensions.rb +0 -57
- data/lib/capistrano/fix_rake_deprecated_dsl.rb +0 -8
- data/lib/capistrano/logger.rb +0 -166
- data/lib/capistrano/processable.rb +0 -55
- data/lib/capistrano/recipes/compat.rb +0 -32
- data/lib/capistrano/recipes/deploy/assets.rb +0 -202
- data/lib/capistrano/recipes/deploy/dependencies.rb +0 -44
- data/lib/capistrano/recipes/deploy/local_dependency.rb +0 -54
- data/lib/capistrano/recipes/deploy/remote_dependency.rb +0 -117
- data/lib/capistrano/recipes/deploy/scm/accurev.rb +0 -169
- data/lib/capistrano/recipes/deploy/scm/base.rb +0 -200
- data/lib/capistrano/recipes/deploy/scm/bzr.rb +0 -86
- data/lib/capistrano/recipes/deploy/scm/cvs.rb +0 -153
- data/lib/capistrano/recipes/deploy/scm/darcs.rb +0 -96
- data/lib/capistrano/recipes/deploy/scm/git.rb +0 -299
- data/lib/capistrano/recipes/deploy/scm/mercurial.rb +0 -137
- data/lib/capistrano/recipes/deploy/scm/none.rb +0 -55
- data/lib/capistrano/recipes/deploy/scm/perforce.rb +0 -152
- data/lib/capistrano/recipes/deploy/scm/subversion.rb +0 -121
- data/lib/capistrano/recipes/deploy/scm.rb +0 -19
- data/lib/capistrano/recipes/deploy/strategy/base.rb +0 -92
- data/lib/capistrano/recipes/deploy/strategy/checkout.rb +0 -20
- data/lib/capistrano/recipes/deploy/strategy/copy.rb +0 -338
- data/lib/capistrano/recipes/deploy/strategy/export.rb +0 -20
- data/lib/capistrano/recipes/deploy/strategy/remote.rb +0 -52
- data/lib/capistrano/recipes/deploy/strategy/remote_cache.rb +0 -57
- data/lib/capistrano/recipes/deploy/strategy/unshared_remote_cache.rb +0 -21
- data/lib/capistrano/recipes/deploy/strategy.rb +0 -20
- data/lib/capistrano/recipes/deploy.rb +0 -625
- data/lib/capistrano/recipes/standard.rb +0 -37
- data/lib/capistrano/recipes/templates/maintenance.rhtml +0 -53
- data/lib/capistrano/role.rb +0 -102
- data/lib/capistrano/server_definition.rb +0 -56
- data/lib/capistrano/shell.rb +0 -265
- data/lib/capistrano/ssh.rb +0 -95
- data/lib/capistrano/task_definition.rb +0 -77
- data/lib/capistrano/transfer.rb +0 -218
- data/test/cli/execute_test.rb +0 -132
- data/test/cli/help_test.rb +0 -165
- data/test/cli/options_test.rb +0 -329
- data/test/cli/ui_test.rb +0 -28
- data/test/cli_test.rb +0 -17
- data/test/command_test.rb +0 -322
- data/test/configuration/actions/file_transfer_test.rb +0 -61
- data/test/configuration/actions/inspect_test.rb +0 -76
- data/test/configuration/actions/invocation_test.rb +0 -306
- data/test/configuration/alias_task_test.rb +0 -118
- data/test/configuration/callbacks_test.rb +0 -201
- data/test/configuration/connections_test.rb +0 -439
- data/test/configuration/execution_test.rb +0 -175
- data/test/configuration/loading_test.rb +0 -148
- data/test/configuration/namespace_dsl_test.rb +0 -332
- data/test/configuration/roles_test.rb +0 -157
- data/test/configuration/servers_test.rb +0 -183
- data/test/configuration/variables_test.rb +0 -190
- data/test/configuration_test.rb +0 -77
- data/test/deploy/local_dependency_test.rb +0 -76
- data/test/deploy/remote_dependency_test.rb +0 -146
- data/test/deploy/scm/accurev_test.rb +0 -23
- data/test/deploy/scm/base_test.rb +0 -55
- data/test/deploy/scm/bzr_test.rb +0 -51
- data/test/deploy/scm/darcs_test.rb +0 -37
- data/test/deploy/scm/git_test.rb +0 -274
- data/test/deploy/scm/mercurial_test.rb +0 -134
- data/test/deploy/scm/none_test.rb +0 -35
- data/test/deploy/scm/perforce_test.rb +0 -23
- data/test/deploy/scm/subversion_test.rb +0 -68
- data/test/deploy/strategy/copy_test.rb +0 -360
- data/test/extensions_test.rb +0 -69
- data/test/fixtures/cli_integration.rb +0 -5
- data/test/fixtures/config.rb +0 -5
- data/test/fixtures/custom.rb +0 -3
- data/test/logger_formatting_test.rb +0 -149
- data/test/logger_test.rb +0 -134
- data/test/recipes_test.rb +0 -25
- data/test/role_test.rb +0 -11
- data/test/server_definition_test.rb +0 -121
- data/test/shell_test.rb +0 -96
- data/test/ssh_test.rb +0 -113
- data/test/task_definition_test.rb +0 -117
- data/test/transfer_test.rb +0 -168
- data/test/utils.rb +0 -37
- data/test/version_test.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: c688937076353e672e483049ea38a97d6000864f
|
|
4
|
+
data.tar.gz: eace1bc67b4b34e947afecd46370f25c1cfae865
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6b5223d084c7fae6f9b94d10adddccbdf6e84bbf3e147192242096526b8056062764b975e33e7d2907cd915ea47578a829a021eee2b19f1f8563578dd3bbb2a
|
|
7
|
+
data.tar.gz: 9e1e8f12c083f26d10cde152f0175c9606faca0eb885dd3f432ab07a56f8a2b7eea6e51637b9ae0b60e2abc983cfc0c9ae06e0f6abb62e47eeaa8ae8d677a1bd
|
data/.gitignore
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
coverage
|
|
2
|
-
doc
|
|
3
|
-
pkg
|
|
4
|
-
*.swp
|
|
5
|
-
*.patch
|
|
6
1
|
*.gem
|
|
7
|
-
*.
|
|
8
|
-
.
|
|
9
|
-
.
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
10
6
|
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
.rspec-local
|
|
19
|
+
.ruby-version
|
data/Gemfile
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
source
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
# Specify your gem's dependencies in capistrano.gemspec
|
|
4
4
|
gemspec
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
# Development Dependencies from the Gemfile
|
|
8
|
-
# are merged here.
|
|
9
|
-
#
|
|
10
|
-
group :development do
|
|
11
|
-
gem "rake"
|
|
12
|
-
gem "rexml"
|
|
13
|
-
gem "pry"
|
|
14
|
-
gem "test-unit"
|
|
15
|
-
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
2
|
+
a copy of this software and associated documentation files (the
|
|
3
|
+
"Software"), to deal in the Software without restriction, including
|
|
4
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
5
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
6
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
7
|
+
the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be
|
|
10
|
+
included in all copies or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
13
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
15
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
16
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
17
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,94 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
# Capistrano [](https://travis-ci.org/capistrano/capistrano)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Status](https://secure.travis-ci.org/capistrano/capistrano.png)](http://travis-ci.org/capistrano/capistrano)[](https://codeclimate.com/github/capistrano/capistrano)
|
|
3
|
+
TODO
|
|
5
4
|
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
multiple remote machines, via SSH. It uses a simple DSL (borrowed in part from
|
|
9
|
-
[Rake](http://rake.rubyforge.org/)) that allows you to define _tasks_, which may
|
|
10
|
-
be applied to machines in certain roles. It also supports tunneling connections
|
|
11
|
-
via some gateway machine to allow operations to be performed behind VPN's and
|
|
12
|
-
firewalls.
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
applications to distributed environments, and originally came bundled with a set
|
|
16
|
-
of tasks designed for deploying Rails applications.
|
|
9
|
+
gem 'capistrano', github: 'capistrano/capistrano', branch: :v3
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
And then execute:
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
$ bundle --binstubs
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
Capify:
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
* [Net::SFTP](http://net-ssh.rubyforge.org)
|
|
26
|
-
* [Net::SCP](http://net-ssh.rubyforge.org)
|
|
27
|
-
* [Net::SSH::Gateway](http://net-ssh.rubyforge.org)
|
|
28
|
-
* [HighLine](http://highline.rubyforge.org)
|
|
29
|
-
* [Ruby](http://www.ruby-lang.org/en/) ≥ 1.8.7
|
|
17
|
+
$ cap install
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
Bundler, see the `Gemfile` within .
|
|
19
|
+
This creates the following files:
|
|
33
20
|
|
|
34
|
-
|
|
21
|
+
- `Capfile`
|
|
22
|
+
- `lib/deploy/tasks`
|
|
23
|
+
- `config/deploy/staging.rb`
|
|
24
|
+
- `config/deploy/production.rb`
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
how things ought to be done, and tries to force those ideas on you. Some of the
|
|
38
|
-
assumptions behind these opinions are:
|
|
26
|
+
To create different stages:
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
* You either have the same password to all target machines, or you have public
|
|
42
|
-
keys in place to allow passwordless access to them.
|
|
28
|
+
$ cap install STAGES=local,sandbox,qa,production
|
|
43
29
|
|
|
44
|
-
|
|
30
|
+
## Usage
|
|
45
31
|
|
|
46
|
-
|
|
32
|
+
$ cap -vT
|
|
47
33
|
|
|
48
|
-
|
|
34
|
+
$ cap staging deploy
|
|
35
|
+
$ cap production deploy
|
|
49
36
|
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
$ cap production deploy --dry-run
|
|
38
|
+
$ cap production deploy --prereqs
|
|
39
|
+
$ cap production deploy --trace
|
|
52
40
|
|
|
53
|
-
|
|
41
|
+
## Configuration
|
|
54
42
|
|
|
55
|
-
|
|
43
|
+
# config/deploy.rb
|
|
44
|
+
set :application, 'example app'
|
|
56
45
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"cap -h" to see all the available options and "cap -T" to see all the available
|
|
60
|
-
tasks.
|
|
46
|
+
# config/deploy/production.rb
|
|
47
|
+
set :stage, :production
|
|
61
48
|
|
|
62
|
-
|
|
49
|
+
ask :branch, :master
|
|
63
50
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
commit
|
|
68
|
-
* Push to your branch - `git push origin my_branch`
|
|
69
|
-
* Create a Pull Request from your branch, include as much documentation
|
|
70
|
-
as you can in the commit message/pull request, following these
|
|
71
|
-
[guidelines on writing a good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
|
72
|
-
* That's it!
|
|
51
|
+
role :app, %w{example.com example2.com}
|
|
52
|
+
role :web, %w{example.com}
|
|
53
|
+
role :db, %w{example.com}
|
|
73
54
|
|
|
55
|
+
# the first server in the array is considered primary
|
|
74
56
|
|
|
75
|
-
##
|
|
57
|
+
## Tasks
|
|
58
|
+
|
|
59
|
+
## Before / After
|
|
60
|
+
|
|
61
|
+
Where calling on the same task name, executed in order of inclusion
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
# call an existing task
|
|
65
|
+
before :starting, :ensure_user
|
|
66
|
+
|
|
67
|
+
after :finishing, :notify
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# or define in block
|
|
71
|
+
before :starting, :ensure_user do
|
|
72
|
+
#
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
after :finishing, :notify do
|
|
76
|
+
#
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
## Console
|
|
80
|
+
|
|
81
|
+
Execute arbitrary remote commands
|
|
82
|
+
|
|
83
|
+
$ cap staging console
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## SSHKit
|
|
76
89
|
|
|
77
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
78
|
-
a copy of this software and associated documentation files (the
|
|
79
|
-
'Software'), to deal in the Software without restriction, including
|
|
80
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
81
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
82
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
83
|
-
the following conditions:
|
|
84
90
|
|
|
85
|
-
The above copyright notice and this permission notice shall be
|
|
86
|
-
included in all copies or substantial portions of the Software.
|
|
87
91
|
|
|
88
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
89
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
90
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
91
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
92
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
93
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
94
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
Bundler::GemHelper.install_tasks
|
|
1
|
+
require "bundler/gem_tasks"
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
test.pattern = 'test/**/*_test.rb'
|
|
8
|
-
test.verbose = true
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
task :default => :test
|
|
3
|
+
task :default => :spec
|
|
4
|
+
require 'rspec/core/rake_task'
|
|
5
|
+
RSpec::Core::RakeTask.new
|
data/bin/cap
CHANGED
data/bin/capify
CHANGED
|
@@ -1,92 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
opts.on("-h", "--help", "Displays this help info") do
|
|
10
|
-
puts opts
|
|
11
|
-
exit 0
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
begin
|
|
15
|
-
opts.parse!(ARGV)
|
|
16
|
-
rescue OptionParser::ParseError => e
|
|
17
|
-
warn e.message
|
|
18
|
-
puts opts
|
|
19
|
-
exit 1
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
if ARGV.empty?
|
|
24
|
-
abort "Please specify the directory to capify, e.g. `#{File.basename($0)} .'"
|
|
25
|
-
elsif !File.exist?(ARGV.first)
|
|
26
|
-
abort "`#{ARGV.first}' does not exist."
|
|
27
|
-
elsif !File.directory?(ARGV.first)
|
|
28
|
-
abort "`#{ARGV.first}' is not a directory."
|
|
29
|
-
elsif ARGV.length > 1
|
|
30
|
-
abort "Too many arguments; please specify only the directory to capify."
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def unindent(string)
|
|
34
|
-
indentation = string[/\A\s*/]
|
|
35
|
-
string.strip.gsub(/^#{indentation}/, "")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
files = {
|
|
39
|
-
"Capfile" => unindent(<<-FILE),
|
|
40
|
-
|
|
41
|
-
load 'deploy'
|
|
42
|
-
|
|
43
|
-
# Uncomment if you are using Rails' asset pipeline
|
|
44
|
-
# load 'deploy/assets'
|
|
45
|
-
|
|
46
|
-
load 'config/deploy' # remove this line to skip loading any of the default tasks
|
|
47
|
-
FILE
|
|
48
|
-
|
|
49
|
-
"config/deploy.rb" => 'set :application, "set your application name here"
|
|
50
|
-
set :repository, "set your repository location here"
|
|
51
|
-
|
|
52
|
-
# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
|
|
53
|
-
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
|
|
54
|
-
|
|
55
|
-
role :web, "your web-server here" # Your HTTP server, Apache/etc
|
|
56
|
-
role :app, "your app-server here" # This may be the same as your `Web` server
|
|
57
|
-
role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run
|
|
58
|
-
role :db, "your slave db-server here"
|
|
59
|
-
|
|
60
|
-
# if you want to clean up old releases on each deploy uncomment this:
|
|
61
|
-
# after "deploy:restart", "deploy:cleanup"
|
|
62
|
-
|
|
63
|
-
# if you\'re still using the script/reaper helper you will need
|
|
64
|
-
# these http://github.com/rails/irs_process_scripts
|
|
65
|
-
|
|
66
|
-
# If you are using Passenger mod_rails uncomment this:
|
|
67
|
-
# namespace :deploy do
|
|
68
|
-
# task :start do ; end
|
|
69
|
-
# task :stop do ; end
|
|
70
|
-
# task :restart, :roles => :app, :except => { :no_release => true } do
|
|
71
|
-
# run "#{try_sudo} touch #{File.join(current_path,\'tmp\',\'restart.txt\')}"
|
|
72
|
-
# end
|
|
73
|
-
# end'}
|
|
74
|
-
|
|
75
|
-
base = ARGV.shift
|
|
76
|
-
files.each do |file, content|
|
|
77
|
-
file = File.join(base, file)
|
|
78
|
-
if File.exist?(file)
|
|
79
|
-
warn "[skip] '#{file}' already exists"
|
|
80
|
-
elsif File.exist?(file.downcase)
|
|
81
|
-
warn "[skip] '#{file.downcase}' exists, which could conflict with `#{file}'"
|
|
82
|
-
else
|
|
83
|
-
unless File.exist?(File.dirname(file))
|
|
84
|
-
puts "[add] making directory '#{File.dirname(file)}'"
|
|
85
|
-
FileUtils.mkdir(File.dirname(file))
|
|
86
|
-
end
|
|
87
|
-
puts "[add] writing '#{file}'"
|
|
88
|
-
File.open(file, "w") { |f| f.write(content) }
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
puts "[done] capified!"
|
|
2
|
+
puts "-" * 80
|
|
3
|
+
puts "Capistrano 3.x is incompatible with Capistrano 2.x. "
|
|
4
|
+
puts
|
|
5
|
+
puts "This command has become `cap install` in Capistrano 3.x"
|
|
6
|
+
puts
|
|
7
|
+
puts "For more information see http://www.capistranorb.com/"
|
|
8
|
+
puts "-" * 80
|
data/capistrano.gemspec
CHANGED
|
@@ -1,40 +1,26 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'capistrano/version'
|
|
4
5
|
|
|
5
|
-
Gem::Specification.new do |
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "capistrano"
|
|
8
|
+
gem.version = Capistrano::VERSION
|
|
9
|
+
gem.authors = ["Tom Clements"]
|
|
10
|
+
gem.email = ["seenmyfate@gmail.com"]
|
|
11
|
+
gem.description = %q{PENDING: Write a gem description}
|
|
12
|
+
gem.summary = %q{PENDING: Write a gem summary}
|
|
13
|
+
gem.homepage = ""
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
s.email = ["jamis@jamisbuck.org", "lee.hambley@gmail.com"]
|
|
12
|
-
s.homepage = "http://github.com/capistrano/capistrano"
|
|
13
|
-
s.summary = %q{Capistrano - Welcome to easy deployment with Ruby over SSH}
|
|
14
|
-
s.description = %q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.}
|
|
15
|
-
s.files = `git ls-files`.split("\n")
|
|
16
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
18
|
-
s.require_paths = ["lib"]
|
|
19
|
-
s.extra_rdoc_files = [
|
|
20
|
-
"README.md"
|
|
21
|
-
]
|
|
15
|
+
gem.files = `git ls-files`.split($/)
|
|
16
|
+
gem.executables = 'cap'
|
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
|
+
gem.require_paths = ["lib"]
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
gem.add_dependency 'sshkit', '>= 0.0.23'
|
|
21
|
+
gem.add_dependency 'rake', '>= 10.0.0'
|
|
22
|
+
gem.add_dependency 'i18n'
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.14"])
|
|
28
|
-
s.add_runtime_dependency(%q<net-sftp>, [">= 2.0.0"])
|
|
29
|
-
s.add_runtime_dependency(%q<net-scp>, [">= 1.0.0"])
|
|
30
|
-
s.add_runtime_dependency(%q<net-ssh-gateway>, [">= 1.1.0"])
|
|
31
|
-
s.add_development_dependency(%q<mocha>, ["0.9.12"])
|
|
32
|
-
else
|
|
33
|
-
s.add_dependency(%q<net-ssh>, [">= 2.0.14"])
|
|
34
|
-
s.add_dependency(%q<net-sftp>, [">= 2.0.0"])
|
|
35
|
-
s.add_dependency(%q<net-scp>, [">= 1.0.0"])
|
|
36
|
-
s.add_dependency(%q<net-ssh-gateway>, [">= 1.1.0"])
|
|
37
|
-
s.add_dependency(%q<highline>, [">= 0"])
|
|
38
|
-
s.add_dependency(%q<mocha>, ["0.9.12"])
|
|
39
|
-
end
|
|
24
|
+
gem.add_development_dependency 'rspec'
|
|
25
|
+
gem.add_development_dependency 'mocha'
|
|
40
26
|
end
|
data/lib/Capfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Capistrano
|
|
2
|
+
class Application < Rake::Application
|
|
3
|
+
include Rake::DSL
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
super
|
|
7
|
+
@rakefiles = %w{capfile Capfile capfile.rb Capfile.rb} << capfile
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def run
|
|
11
|
+
Rake.application = self
|
|
12
|
+
super
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def load_rakefile
|
|
16
|
+
@name = 'cap'
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
# allows the `cap install` task to load without a capfile
|
|
23
|
+
def capfile
|
|
24
|
+
File.expand_path(File.join(File.dirname(__FILE__),'..','Capfile'))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
load File.expand_path("../tasks/bundler.rake", __FILE__)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Capistrano
|
|
2
|
+
class Configuration
|
|
3
|
+
class Question
|
|
4
|
+
|
|
5
|
+
def initialize(env, key, default)
|
|
6
|
+
@env, @key, @default = env, key, default
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def call
|
|
10
|
+
ask_question
|
|
11
|
+
save_response
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
attr_reader :env, :key, :default
|
|
16
|
+
|
|
17
|
+
def ask_question
|
|
18
|
+
$stdout.puts question
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def save_response
|
|
22
|
+
env.set(key, value)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def value
|
|
26
|
+
if response.empty?
|
|
27
|
+
default
|
|
28
|
+
else
|
|
29
|
+
response
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def response
|
|
34
|
+
@response ||= $stdin.gets.chomp
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def question
|
|
38
|
+
I18n.t(:question, key: key, default_value: default, scope: :capistrano)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
module Capistrano
|
|
3
|
+
class Configuration
|
|
4
|
+
class Server < SSHKit::Host
|
|
5
|
+
|
|
6
|
+
def add_role(role)
|
|
7
|
+
roles << role.to_sym
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def has_role?(role)
|
|
11
|
+
roles.include? role.to_sym
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def matches?(host)
|
|
15
|
+
hostname == Server.new(host).hostname
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def roles
|
|
19
|
+
properties.roles ||= Set.new
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|