capistrano-rails 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +41 -25
- data/capistrano-rails.gemspec +1 -1
- data/lib/capistrano/tasks/assets.rake +11 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45a9dad70b2ce330f6fef57d0d1bfb633a50e57b
|
4
|
+
data.tar.gz: 9a7e56761759025fefda6d1ae96d388ac873fa77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1355a3af7d085d8dd7add88db62a81958cea0fa368e4f26e61a2d5418ae0a73a8306317b9ce75383b9c3e845f5fa14e450c5dd77e3665d0f1e54623215b38615
|
7
|
+
data.tar.gz: 21b5cb0fdc2b1fa18714f5aae1b4e6822890f8fe808472943dca07fed304dd2c72af9ae3f551a62a3c86e7f2a8005c69e4c41e79ae84414d15026f11dab92eed
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 1.1.4 (Oct 10 2015)
|
2
|
+
|
3
|
+
* Fixing bug with normalize_assets typo #138
|
4
|
+
* Cleanup assets after:updated (#136)
|
5
|
+
* Fixed linked_dirs containing default value of assets_prefix (#125)
|
6
|
+
|
1
7
|
# 1.1.3 (Apr 18 2015)
|
2
8
|
|
3
9
|
* Fixed no_release behaviour (https://github.com/capistrano/rails/pull/95)
|
data/README.md
CHANGED
@@ -5,53 +5,69 @@ Rails specific tasks for Capistrano v3:
|
|
5
5
|
- `cap deploy:migrate`
|
6
6
|
- `cap deploy:compile_assets`
|
7
7
|
|
8
|
-
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
9
11
|
|
10
12
|
```ruby
|
11
|
-
|
12
|
-
|
13
|
-
set :conditionally_migrate, true # Defaults to false. If true, it's skip migration if files in db/migrate not modified
|
14
|
-
set :assets_roles, [:web, :app] # Defaults to [:web]
|
15
|
-
set :assets_prefix, 'prepackaged-assets' # Defaults to 'assets' this should match config.assets.prefix in your rails config/application.rb
|
13
|
+
gem 'capistrano', '~> 3.1'
|
14
|
+
gem 'capistrano-rails', '~> 1.1'
|
16
15
|
```
|
17
16
|
|
18
|
-
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
Require everything (`bundler`, `rails/assets` and `rails/migrations`):
|
19
20
|
|
20
21
|
```ruby
|
21
|
-
|
22
|
+
# Capfile
|
23
|
+
require 'capistrano/rails'
|
22
24
|
```
|
23
25
|
|
24
|
-
|
26
|
+
Or require just what you need manually:
|
25
27
|
|
26
|
-
|
28
|
+
```ruby
|
29
|
+
# Capfile
|
30
|
+
require 'capistrano/bundler' # Rails needs Bundler, right?
|
31
|
+
require 'capistrano/rails/assets'
|
32
|
+
require 'capistrano/rails/migrations'
|
33
|
+
```
|
27
34
|
|
28
|
-
|
29
|
-
gem 'capistrano-rails', '~> 1.1'
|
35
|
+
Please note that any `require`s should be placed in `Capfile`, not in `config/deploy.rb`.
|
30
36
|
|
31
|
-
|
37
|
+
You can tweak some Rails-specific options in `config/deploy.rb`:
|
32
38
|
|
33
|
-
|
39
|
+
```ruby
|
40
|
+
# If the environment differs from the stage name
|
41
|
+
set :rails_env, 'staging'
|
34
42
|
|
35
|
-
|
36
|
-
|
43
|
+
# Defaults to 'db'
|
44
|
+
set :migration_role, 'migrator'
|
37
45
|
|
38
|
-
|
46
|
+
# Defaults to false
|
47
|
+
# Skip migration if files in db/migrate were not modified
|
48
|
+
set :conditionally_migrate, true
|
39
49
|
|
40
|
-
|
41
|
-
|
42
|
-
require 'capistrano/rails/assets'
|
43
|
-
require 'capistrano/rails/migrations'
|
50
|
+
# Defaults to [:web]
|
51
|
+
set :assets_roles, [:web, :app]
|
44
52
|
|
45
|
-
|
53
|
+
# Defaults to 'assets'
|
54
|
+
# This should match config.assets.prefix in your rails config/application.rb
|
55
|
+
set :assets_prefix, 'prepackaged-assets'
|
56
|
+
|
57
|
+
# If you need to touch public/images, public/javascripts, and public/stylesheets on each deploy
|
58
|
+
set :normalize_asset_timestamps, %{public/images public/javascripts public/stylesheets}
|
59
|
+
```
|
46
60
|
|
47
61
|
### Symlinks
|
48
62
|
|
49
63
|
You'll probably want to symlink Rails shared files and directories like `log`, `tmp` and `public/uploads`.
|
50
64
|
Make sure you enable it by setting `linked_dirs` and `linked_files` options:
|
51
65
|
|
52
|
-
|
53
|
-
|
54
|
-
|
66
|
+
```ruby
|
67
|
+
# deploy.rb
|
68
|
+
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
|
69
|
+
set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
|
70
|
+
```
|
55
71
|
|
56
72
|
## Contributing
|
57
73
|
|
data/capistrano-rails.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "capistrano-rails"
|
7
|
-
gem.version = '1.1.
|
7
|
+
gem.version = '1.1.4'
|
8
8
|
gem.authors = ["Tom Clements", "Lee Hambley", "Kir Shatrov"]
|
9
9
|
gem.email = ["seenmyfate@gmail.com", "lee.hambley@gmail.com", "shatrov@me.com"]
|
10
10
|
gem.description = %q{Rails specific Capistrano tasks}
|
@@ -24,7 +24,6 @@ namespace :deploy do
|
|
24
24
|
invoke 'deploy:assets:backup_manifest'
|
25
25
|
end
|
26
26
|
|
27
|
-
# FIXME: it removes every asset it has just compiled
|
28
27
|
desc 'Cleanup expired assets'
|
29
28
|
task :cleanup_assets => [:set_rails_env] do
|
30
29
|
on release_roles(fetch(:assets_roles)) do
|
@@ -46,8 +45,7 @@ namespace :deploy do
|
|
46
45
|
end
|
47
46
|
|
48
47
|
after 'deploy:updated', 'deploy:compile_assets'
|
49
|
-
|
50
|
-
# after 'deploy:updated', 'deploy:cleanup_assets'
|
48
|
+
after 'deploy:updated', 'deploy:cleanup_assets'
|
51
49
|
after 'deploy:updated', 'deploy:normalize_assets'
|
52
50
|
after 'deploy:reverted', 'deploy:rollback_assets'
|
53
51
|
|
@@ -106,10 +104,19 @@ namespace :deploy do
|
|
106
104
|
end
|
107
105
|
end
|
108
106
|
|
107
|
+
# we can't set linked_dirs in load:defaults,
|
108
|
+
# as assets_prefix will always have a default value
|
109
|
+
namespace :deploy do
|
110
|
+
task :set_linked_dirs do
|
111
|
+
set :linked_dirs, fetch(:linked_dirs, []).push("public/#{fetch(:assets_prefix)}")
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
after 'deploy:set_rails_env', 'deploy:set_linked_dirs'
|
116
|
+
|
109
117
|
namespace :load do
|
110
118
|
task :defaults do
|
111
119
|
set :assets_roles, fetch(:assets_roles, [:web])
|
112
120
|
set :assets_prefix, fetch(:assets_prefix, 'assets')
|
113
|
-
set :linked_dirs, fetch(:linked_dirs, []).push("public/#{fetch(:assets_prefix)}")
|
114
121
|
end
|
115
122
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capistrano
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.4.5
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Rails specific Capistrano tasks
|