capistrano 3.0.0.pre → 3.0.0.pre2
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/README.md +51 -48
- data/lib/capistrano/templates/Capfile +12 -12
- data/lib/capistrano/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38d0a3ff8b874c2e4d430c269c18f76d93964753
|
4
|
+
data.tar.gz: 52b27720df0d2b9ae3908dcdaef8e1f5eca195af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dd61efc447d0b8169d354a126bbfb81845d739426e8c3d60752f3038f4e2c2b0f4fc9b94b87a7df41511ea49859193e04a525ef7fcd2ceb5b8d2bf6c7318b96
|
7
|
+
data.tar.gz: cf0d253ec7463e3e6e3f106d2f7ceaf30996b61156a59e42852de237f2556b786cc00b1781f016d734b77a995a848677a85023f04b1e687ebd5b6e3fbf8adc55
|
data/README.md
CHANGED
@@ -1,91 +1,94 @@
|
|
1
1
|
# Capistrano [](https://travis-ci.org/capistrano/capistrano)
|
2
2
|
|
3
|
-
TODO
|
4
|
-
|
5
3
|
## Installation
|
6
4
|
|
7
5
|
Add this line to your application's Gemfile:
|
8
6
|
|
9
|
-
|
7
|
+
``` ruby
|
8
|
+
gem 'capistrano', github: 'capistrano/capistrano', branch: :v3
|
9
|
+
```
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
13
|
-
|
13
|
+
``` ruby
|
14
|
+
$ bundle --binstubs
|
15
|
+
```
|
14
16
|
|
15
17
|
Capify:
|
16
18
|
|
17
|
-
|
19
|
+
``` shell
|
20
|
+
$ cap install
|
21
|
+
```
|
18
22
|
|
19
23
|
This creates the following files:
|
20
24
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
```
|
26
|
+
├── Capfile
|
27
|
+
├── config
|
28
|
+
│ ├── deploy
|
29
|
+
│ │ ├── production.rb
|
30
|
+
│ │ └── staging.rb
|
31
|
+
│ └── deploy.rb
|
32
|
+
└── lib
|
33
|
+
└── capistrano
|
34
|
+
└── tasks
|
35
|
+
```
|
25
36
|
|
26
37
|
To create different stages:
|
27
38
|
|
28
|
-
|
39
|
+
``` shell
|
40
|
+
$ cap install STAGES=local,sandbox,qa,production
|
41
|
+
```
|
29
42
|
|
30
43
|
## Usage
|
31
44
|
|
32
|
-
|
33
|
-
|
34
|
-
$ cap staging deploy
|
35
|
-
$ cap production deploy
|
36
|
-
|
37
|
-
$ cap production deploy --dry-run
|
38
|
-
$ cap production deploy --prereqs
|
39
|
-
$ cap production deploy --trace
|
40
|
-
|
41
|
-
## Configuration
|
42
|
-
|
43
|
-
# config/deploy.rb
|
44
|
-
set :application, 'example app'
|
45
|
+
``` shell
|
46
|
+
$ cap -vT
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
+
$ cap staging deploy
|
49
|
+
$ cap production deploy
|
48
50
|
|
49
|
-
|
51
|
+
$ cap production deploy --dry-run
|
52
|
+
$ cap production deploy --prereqs
|
53
|
+
$ cap production deploy --trace
|
54
|
+
```
|
50
55
|
|
51
|
-
|
52
|
-
role :web, %w{example.com}
|
53
|
-
role :db, %w{example.com}
|
56
|
+
## Tasks
|
54
57
|
|
55
|
-
# the first server in the array is considered primary
|
56
58
|
|
57
|
-
## Tasks
|
58
59
|
|
59
60
|
## Before / After
|
60
61
|
|
61
62
|
Where calling on the same task name, executed in order of inclusion
|
62
63
|
|
64
|
+
``` ruby
|
65
|
+
# call an existing task
|
66
|
+
before :starting, :ensure_user
|
63
67
|
|
64
|
-
|
65
|
-
before :starting, :ensure_user
|
66
|
-
|
67
|
-
after :finishing, :notify
|
68
|
+
after :finishing, :notify
|
68
69
|
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
# or define in block
|
72
|
+
before :starting, :ensure_user do
|
73
|
+
#
|
74
|
+
end
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
after :finishing, :notify do
|
77
|
+
#
|
78
|
+
end
|
79
|
+
```
|
78
80
|
|
79
81
|
## Console
|
80
82
|
|
81
|
-
Execute arbitrary remote commands
|
83
|
+
Execute arbitrary remote commands, to use this simply add
|
84
|
+
`require 'capistrano/console'` which will add the necessary tasks to your
|
85
|
+
environment:
|
82
86
|
|
83
|
-
|
87
|
+
``` shell
|
88
|
+
$ cap staging console
|
89
|
+
```
|
84
90
|
|
85
91
|
## Configuration
|
86
92
|
|
87
93
|
|
88
|
-
## SSHKit
|
89
|
-
|
90
|
-
|
91
|
-
|
94
|
+
## SSHKit
|
@@ -1,12 +1,7 @@
|
|
1
|
-
|
2
|
-
# loads dsl, sets up stages
|
1
|
+
# Load DSL and Setup Up Stages
|
3
2
|
require 'capistrano/setup'
|
4
3
|
|
5
|
-
#
|
6
|
-
require 'capistrano/console'
|
7
|
-
|
8
|
-
# includes default deployment tasks
|
9
|
-
# remove to start completely from scratch
|
4
|
+
# Includes default deployment tasks
|
10
5
|
require 'capistrano/deploy'
|
11
6
|
|
12
7
|
# Includes tasks from other gems included in your Gemfile
|
@@ -20,24 +15,29 @@ require 'capistrano/deploy'
|
|
20
15
|
# require 'capistrano/bundler'
|
21
16
|
# require 'capistrano/rails/assets'
|
22
17
|
# require 'capistrano/rails/migrations'
|
23
|
-
# require 'capistrano/heroku'
|
24
18
|
|
25
|
-
# Loads custom tasks from lib/capistrano/tasks if you have any defined.
|
26
|
-
|
19
|
+
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
|
20
|
+
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
|
27
21
|
|
28
22
|
namespace :deploy do
|
23
|
+
|
29
24
|
desc 'Restart application'
|
30
25
|
task :restart do
|
31
26
|
on roles(:app), in: :sequence, wait: 5 do
|
32
|
-
#
|
27
|
+
# Your restart mechanism here, for example:
|
28
|
+
# execute :touch, release_path.join('tmp/restart.txt')
|
33
29
|
end
|
34
30
|
end
|
35
31
|
|
36
32
|
after :restart, :clear_cache do
|
37
33
|
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
38
|
-
#
|
34
|
+
# Here we can do anything such as:
|
35
|
+
# within latest_relese_path do
|
36
|
+
# execute :rake, 'cache:clear'
|
37
|
+
# end
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
42
41
|
after :finishing, 'deploy:cleanup'
|
42
|
+
|
43
43
|
end
|
data/lib/capistrano/version.rb
CHANGED