capistrano-helpers 0.9.1 → 0.10.0
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/.ruby-version +1 -0
- data/{README.rdoc → README.md} +79 -70
- data/VERSION +1 -1
- data/capistrano-helpers.gemspec +7 -5
- data/lib/capistrano-helpers/robots.rb +15 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2565c2634ee8996d143d90ac9a6c2e03baa37876
|
4
|
+
data.tar.gz: 244dae3d4214ecf271d162f1a86b6b11a4a0372a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e8a0889476ba5e8366af76ec114a3a59fb1ad96e957d08354734259966634dbdf57288d29838cda7b8827071cf3afd55f1726e3c72dd205e411de5531ef05b
|
7
|
+
data.tar.gz: d17a3832a4784d7ae4720cd8c31fded0074e547cbe3e4ff1f0a80e244ad711fcb02830274162911b28739cd4c2afbc6481add5f7b1ffe9b6f968d5af2004161e
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.4
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
# capistrano-helpers
|
2
2
|
|
3
3
|
A set of optional extensions to capistrano to make common tasks easier and
|
4
4
|
reduce redundancy across your deployments.
|
5
5
|
|
6
|
-
|
6
|
+
## Usage
|
7
7
|
|
8
8
|
In your capistrano deploy recipe, simply require the helpers that contain the
|
9
9
|
functionality that you would like to add to your recipe. In most cases this
|
@@ -12,120 +12,123 @@ time during deployment.
|
|
12
12
|
|
13
13
|
Here's an example config/deploy.rb that uses a few helpers:
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
15
|
+
require 'capistrano-helpers/passenger' # Support for Apache passenger
|
16
|
+
require 'capistrano-helpers/specs' # Check specs before deploying
|
17
|
+
require 'capistrano-helpers/version' # Record the version number after deploying
|
18
|
+
require 'capistrano-helpers/campfire' # Post deploy info to campfire
|
19
|
+
|
20
|
+
# The name of the application.
|
21
|
+
set :application, "myapp"
|
22
|
+
|
23
|
+
# The source code management software to use.
|
24
|
+
set :scm, "git"
|
25
|
+
|
26
|
+
# Location of the source code.
|
27
|
+
set :repository, "git@github.com:mycompany/myapp.git"
|
28
28
|
|
29
29
|
That's it! The recipe will now also perform the actions described by the
|
30
30
|
helpers (in this case, the campfire helper also requires the tinder gem and
|
31
31
|
a config/campfire.yml file).
|
32
32
|
|
33
|
-
|
33
|
+
## Helpers
|
34
34
|
|
35
|
-
|
35
|
+
### branch
|
36
36
|
|
37
37
|
Prompts the user for the particular tag/branch/commit to deploy.
|
38
38
|
|
39
|
-
|
39
|
+
### bundler
|
40
40
|
|
41
|
-
Automatically runs
|
41
|
+
Automatically runs `bundle install --deployment` to install gems from your Gemfile at the appropriate time.
|
42
42
|
|
43
|
-
|
43
|
+
[Deprecated] This recipe predates bundler's direct support for capistrano. It's best to
|
44
|
+
`require 'bundler/capistrano'` in your recipe now instead of using this helper.
|
45
|
+
|
46
|
+
### campfire
|
44
47
|
|
45
48
|
Once the deploy is complete, this helper will post a message to the given
|
46
49
|
Campfire room stating the username, the application, the branch/tag and the
|
47
50
|
environment. E.g.:
|
48
51
|
|
49
|
-
|
52
|
+
Scott Woods finished deploying myapp v0.5.4 to staging
|
50
53
|
|
51
54
|
By default, it will only post when the deploy is complete. If you'd also
|
52
55
|
like it to post when the deploy begins, you can add the following line
|
53
56
|
to your deploy script:
|
54
57
|
|
55
|
-
|
58
|
+
before "deploy", "deploy:post_to_campfire_before"
|
56
59
|
|
57
60
|
You will need to install the tinder gem to enable campfire notifications. Run
|
58
61
|
<tt>sudo gem install tinder</tt>, or add <tt>gem 'tinder'</tt> to your Gemfile.
|
59
62
|
This helper expects to find a configuration file config/campfire.yml or
|
60
63
|
~/.campfire.yml with the following format:
|
61
64
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
# Configuration for posting to campfire.
|
66
|
+
subdomain: mycompany
|
67
|
+
token: abcd1234567890
|
68
|
+
room: Chatter
|
66
69
|
|
67
70
|
You can override the location of the configuration file by setting the
|
68
71
|
:campfire_config variable:
|
69
72
|
|
70
|
-
|
73
|
+
set :campfire_config, 'somewhere/else.yml'
|
71
74
|
|
72
75
|
You can disable the notification for a specific deployment stage by setting
|
73
76
|
the :campfire_notifications variable to false.
|
74
77
|
E.g. in config/deploy/staging:
|
75
78
|
|
76
|
-
|
79
|
+
set :campfire_notifications, false
|
77
80
|
|
78
|
-
|
81
|
+
### ding
|
79
82
|
|
80
83
|
Once the deploy is complete, this helper will play a 'ding' sound (Mac only).
|
81
84
|
|
82
|
-
|
85
|
+
### features
|
83
86
|
|
84
87
|
Before the app is deployed, this helper checks out the branch/tag that is
|
85
88
|
being deployed and runs all the cucumber features, ensuring that they all
|
86
89
|
pass.
|
87
90
|
|
88
|
-
|
91
|
+
### gems
|
89
92
|
|
90
93
|
Run the gems:install rake task using sudo after deployment.
|
91
94
|
|
92
|
-
|
95
|
+
### git
|
93
96
|
|
94
97
|
Set git as the repository type, and set up remote caching to speed up
|
95
98
|
deployments.
|
96
99
|
|
97
|
-
|
100
|
+
### growl
|
98
101
|
|
99
102
|
Once the deploy is complete, this helper will post a message to Growl stating
|
100
103
|
the application, the branch/tag and the environment. E.g.:
|
101
104
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
+
capistrano
|
106
|
+
|
107
|
+
finished deploying myapp v0.5.4 to staging
|
105
108
|
|
106
|
-
|
109
|
+
### jekyll
|
107
110
|
|
108
111
|
Deploy a static website with [jekyll](http://jekyllrb.com/). Rebuild the site
|
109
112
|
during deployment, and override any server restarts (since it's just a static
|
110
113
|
site).
|
111
114
|
|
112
|
-
|
115
|
+
### migrations
|
113
116
|
|
114
117
|
Always run migrations during deployment.
|
115
118
|
|
116
|
-
|
119
|
+
### passenger
|
117
120
|
|
118
121
|
Overrides the default :restart task so that it's compatible with restarting
|
119
122
|
apache/passenger (aka mod_rails). Touches tmp/restart.txt.
|
120
123
|
|
121
|
-
|
124
|
+
### php
|
122
125
|
|
123
126
|
Use this helper when using capistrano to deploy a purely PHP application.
|
124
127
|
|
125
128
|
This neuters the default :restart and :finalize_updates tasks, since they
|
126
129
|
aren't typically needed for a PHP installation.
|
127
130
|
|
128
|
-
|
131
|
+
### preflight
|
129
132
|
|
130
133
|
Goes through a set of yes/no questions with the user before the application is
|
131
134
|
actually deployed. This provides a way to walk the user through a set of
|
@@ -135,19 +138,25 @@ affirmatively.
|
|
135
138
|
This helper expects to find the questions in a configuration file called
|
136
139
|
config/preflight.yml . The file should be in the following format:
|
137
140
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
141
|
+
# Questions that must be answered "yes" before a deploy is allowed to proceed.
|
142
|
+
- Does cruise control show all tests passing?
|
143
|
+
- Do the staging and production servers have the required gems installed?
|
144
|
+
- Are you prepared to run migrations on the remote server?
|
145
|
+
- Have you tagged this release?
|
146
|
+
- Have you pushed the tags to github?
|
147
|
+
|
145
148
|
You can override the location of the configuration file by setting the
|
146
149
|
:preflight_config variable:
|
147
150
|
|
148
|
-
|
151
|
+
set :preflight_config, 'somewhere/else.yml'
|
152
|
+
|
153
|
+
### robots
|
154
|
+
|
155
|
+
Unless deploying to production, write a `public/robots.txt` file that will
|
156
|
+
disallow all search engine bots and crawlers. This prevents your staging and
|
157
|
+
beta sites from being indexed by Google.
|
149
158
|
|
150
|
-
|
159
|
+
### shared
|
151
160
|
|
152
161
|
During deployment, this helper replaces each of the given paths with a
|
153
162
|
symbolic link that points to the same path under the "shared" directory on the
|
@@ -157,23 +166,23 @@ data that should persist across deployments (uploads, for example).
|
|
157
166
|
After requiring this helper, set the paths to be symlinked using the
|
158
167
|
:shared variable:
|
159
168
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
169
|
+
set :shared, %w{
|
170
|
+
public/uploads
|
171
|
+
public/downloads/huge_files
|
172
|
+
}
|
164
173
|
|
165
174
|
This will create two symbolic links on the production server:
|
166
175
|
|
167
|
-
|
168
|
-
|
176
|
+
#{release_path}/public/uploads -> #{shared_path}/public/uploads
|
177
|
+
#{release_path}/public/downloads/huge_files -> #{shared_path}/public/downloads/huge_files
|
169
178
|
|
170
|
-
|
179
|
+
### skylinecms
|
171
180
|
|
172
181
|
This is for the SkylineCMS gem. Skyline requires certain permissions and folders to operate,
|
173
182
|
and this helper insures they exist. Remember to run this *after* the rest of your symlinks exist
|
174
183
|
(eg. config/database.yml) and *before* anything loads the environment (eg. rake gems:install).
|
175
184
|
|
176
|
-
|
185
|
+
### privates
|
177
186
|
|
178
187
|
This works much like the shared helper above, except the symbolic link will
|
179
188
|
point to the same path under "shared/private" on the server. This allows you
|
@@ -183,32 +192,32 @@ sensitive files safe, such as those that contain passwords or encryption keys.
|
|
183
192
|
After requiring this helper, set the paths to be symlinked using the
|
184
193
|
:privates variable:
|
185
194
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
195
|
+
set :privates, %w{
|
196
|
+
config/database.yml
|
197
|
+
config/session_secret.txt
|
198
|
+
}
|
199
|
+
|
191
200
|
This will create two symbolic links on the production server:
|
192
201
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
202
|
+
#{release_path}/config/database.yml -> #{shared_path}/private/config/database.yml
|
203
|
+
#{release_path}/config/session_secret.txt -> #{shared_path}/private/config/session_secret.txt
|
204
|
+
|
205
|
+
### specs
|
197
206
|
|
198
207
|
Before the app is deployed, this helper checks out the branch/tag that is
|
199
208
|
being deployed and runs all the rspec specs, ensuring that they all pass.
|
200
209
|
|
201
|
-
|
210
|
+
### unicorn
|
202
211
|
|
203
212
|
Overrides the default :restart task so that it's compatible with restarting
|
204
213
|
unicorn.
|
205
214
|
|
206
|
-
|
215
|
+
### version
|
207
216
|
|
208
217
|
Creates a VERSION file in the deployed copy that contains the name of the
|
209
218
|
branch/tag that was deployed. Useful for displaying version information in the
|
210
219
|
app itself.
|
211
220
|
|
212
|
-
|
221
|
+
## Copyright
|
213
222
|
|
214
223
|
Copyright (c) 2014 West Arete Computing, Inc.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
data/capistrano-helpers.gemspec
CHANGED
@@ -2,26 +2,27 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: capistrano-helpers 0.
|
5
|
+
# stub: capistrano-helpers 0.10.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "capistrano-helpers"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.10.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Scott Woods"]
|
14
|
-
s.date = "2014-11-
|
14
|
+
s.date = "2014-11-13"
|
15
15
|
s.description = "A set of optional extensions to capistrano to make common tasks easier."
|
16
16
|
s.email = "team@westarete.com"
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
|
-
"README.
|
19
|
+
"README.md"
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
|
+
".ruby-version",
|
23
24
|
"LICENSE",
|
24
|
-
"README.
|
25
|
+
"README.md",
|
25
26
|
"Rakefile",
|
26
27
|
"VERSION",
|
27
28
|
"capistrano-helpers.gemspec",
|
@@ -40,6 +41,7 @@ Gem::Specification.new do |s|
|
|
40
41
|
"lib/capistrano-helpers/php.rb",
|
41
42
|
"lib/capistrano-helpers/preflight.rb",
|
42
43
|
"lib/capistrano-helpers/privates.rb",
|
44
|
+
"lib/capistrano-helpers/robots.rb",
|
43
45
|
"lib/capistrano-helpers/shared.rb",
|
44
46
|
"lib/capistrano-helpers/skylinecms.rb",
|
45
47
|
"lib/capistrano-helpers/specs.rb",
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../capistrano-helpers' if ! defined?(CapistranoHelpers)
|
2
|
+
|
3
|
+
CapistranoHelpers.with_configuration do
|
4
|
+
|
5
|
+
namespace :deploy do
|
6
|
+
desc "Disallow robots unless deploying to production."
|
7
|
+
task :disallow_robots do
|
8
|
+
unless stage == :production
|
9
|
+
run %{cd #{release_path} && echo "User-agent: *\\nDisallow: /\\n" > public/robots.txt}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
after "deploy:update_code", "deploy:disallow_robots"
|
14
|
+
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Woods
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -58,11 +58,12 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files:
|
60
60
|
- LICENSE
|
61
|
-
- README.
|
61
|
+
- README.md
|
62
62
|
files:
|
63
63
|
- ".document"
|
64
|
+
- ".ruby-version"
|
64
65
|
- LICENSE
|
65
|
-
- README.
|
66
|
+
- README.md
|
66
67
|
- Rakefile
|
67
68
|
- VERSION
|
68
69
|
- capistrano-helpers.gemspec
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- lib/capistrano-helpers/php.rb
|
82
83
|
- lib/capistrano-helpers/preflight.rb
|
83
84
|
- lib/capistrano-helpers/privates.rb
|
85
|
+
- lib/capistrano-helpers/robots.rb
|
84
86
|
- lib/capistrano-helpers/shared.rb
|
85
87
|
- lib/capistrano-helpers/skylinecms.rb
|
86
88
|
- lib/capistrano-helpers/specs.rb
|