capistrano-rails 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ecc06faeb5c6951f9b1dfcfafb26d2cbd75cfb6
4
- data.tar.gz: 7d16b1965fcd7d08b459dfa94f019e4e4b067936
3
+ metadata.gz: 7065170b7a368f7095b8c03cb8c1cf79351a1cc6
4
+ data.tar.gz: e15b821f871fd65299ba87df3b46daa099efcf5f
5
5
  SHA512:
6
- metadata.gz: f128f8adb2ec46f5be5b6f5e951eb7b6585c15ac5f4f57aed4bafe0f543cf2b4750852411c30912b48b960eaea06e98bb0c5a381daa470fca71f1a39e1451ba9
7
- data.tar.gz: fdbd6eb29c0b3d41fc144078869431596df9e9cb2cca9e7e65f4fa8ecdd5da254a4b161f89d23ac8f25e750c88ad6f20ecc7614d2dcde57ba95ccb8a3d560a5d
6
+ metadata.gz: 97634bcd7e7a043c3bc1f0bcc0f8ea21a0704a904cd02501eabd88cc0e602f375b3d522330b97375e20c00408b353141018e6e0fea543448bfc47f53123b99e9
7
+ data.tar.gz: dd80fa91b3b846cb78a13484e29cce1a7a86b412a0f07dec191becf8fd80c62fc7c035c96f01b670b1552ee9c7b256f667f5d99c6082b1266fe068697a56cb25
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
- # future release
1
+ # 1.1.3 (Apr 18 2015)
2
2
 
3
- * ready for contributors
3
+ * Fixed no_release behaviour (https://github.com/capistrano/rails/pull/95)
4
+ * Allow assets manifest backup with folder "manifests" (https://github.com/capistrano/rails/pull/92)
5
+ * Handle Sprocket 3 manifest filename
4
6
 
5
7
  # 1.1.2 (Sep 1 2014)
6
8
 
data/README.md CHANGED
@@ -10,7 +10,7 @@ Some rails specific options.
10
10
  ```ruby
11
11
  set :rails_env, 'staging' # If the environment differs from the stage name
12
12
  set :migration_role, 'migrator' # Defaults to 'db'
13
- set :conditionally_migrate, true # Defaults to false
13
+ set :conditionally_migrate, true # Defaults to false. If true, it's skip migration if files in db/migrate not modified
14
14
  set :assets_roles, [:web, :app] # Defaults to [:web]
15
15
  set :assets_prefix, 'prepackaged-assets' # Defaults to 'assets' this should match config.assets.prefix in your rails config/application.rb
16
16
  ```
@@ -41,9 +41,18 @@ Or require just what you need manually:
41
41
  require 'capistrano/bundler' # Rails needs Bundler, right?
42
42
  require 'capistrano/rails/assets'
43
43
  require 'capistrano/rails/migrations'
44
-
44
+
45
45
  Please note that any `require` should be placed in `Capfile`, not `config/deploy.rb`.
46
46
 
47
+ ### Symlinks
48
+
49
+ You'll probably want to symlink Rails shared files and directories like `log`, `tmp` and `public/uploads`.
50
+ Make sure you enable it by setting `linked_dirs` and `linked_files` options:
51
+
52
+ # deploy.rb
53
+ set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
54
+ set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
55
+
47
56
  ## Contributing
48
57
 
49
58
  1. Fork it
@@ -4,9 +4,9 @@ $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.2'
8
- gem.authors = ["Tom Clements", "Lee Hambley"]
9
- gem.email = ["seenmyfate@gmail.com", "lee.hambley@gmail.com"]
7
+ gem.version = '1.1.3'
8
+ gem.authors = ["Tom Clements", "Lee Hambley", "Kir Shatrov"]
9
+ gem.email = ["seenmyfate@gmail.com", "lee.hambley@gmail.com", "shatrov@me.com"]
10
10
  gem.description = %q{Rails specific Capistrano tasks}
11
11
  gem.summary = %q{Rails specific Capistrano tasks}
12
12
  gem.homepage = "https://github.com/capistrano/rails"
@@ -8,7 +8,7 @@ end
8
8
  namespace :deploy do
9
9
  desc 'Normalize asset timestamps'
10
10
  task :normalize_assets => [:set_rails_env] do
11
- on roles(fetch(:assets_roles)) do
11
+ on release_roles(fetch(:assets_roles)) do
12
12
  assets = fetch(:normalize_asset_timestamps)
13
13
  if assets
14
14
  within release_path do
@@ -27,7 +27,7 @@ namespace :deploy do
27
27
  # FIXME: it removes every asset it has just compiled
28
28
  desc 'Cleanup expired assets'
29
29
  task :cleanup_assets => [:set_rails_env] do
30
- on roles(fetch(:assets_roles)) do
30
+ on release_roles(fetch(:assets_roles)) do
31
31
  within release_path do
32
32
  with rails_env: fetch(:rails_env) do
33
33
  execute :rake, "assets:clean"
@@ -53,7 +53,7 @@ namespace :deploy do
53
53
 
54
54
  namespace :assets do
55
55
  task :precompile do
56
- on roles(fetch(:assets_roles)) do
56
+ on release_roles(fetch(:assets_roles)) do
57
57
  within release_path do
58
58
  with rails_env: fetch(:rails_env) do
59
59
  execute :rake, "assets:precompile"
@@ -63,21 +63,23 @@ namespace :deploy do
63
63
  end
64
64
 
65
65
  task :backup_manifest do
66
- on roles(fetch(:assets_roles)) do
66
+ on release_roles(fetch(:assets_roles)) do
67
67
  within release_path do
68
+ backup_path = release_path.join('assets_manifest_backup')
69
+
70
+ execute :mkdir, '-p', backup_path
68
71
  execute :cp,
69
- release_path.join('public', fetch(:assets_prefix), 'manifest*'),
70
- release_path.join('assets_manifest_backup')
72
+ detect_manifest_path,
73
+ backup_path
71
74
  end
72
75
  end
73
76
  end
74
77
 
75
78
  task :restore_manifest do
76
- on roles(fetch(:assets_roles)) do
79
+ on release_roles(fetch(:assets_roles)) do
77
80
  within release_path do
78
- source = release_path.join('assets_manifest_backup')
79
- target = capture(:ls, release_path.join('public', fetch(:assets_prefix),
80
- 'manifest*')).strip
81
+ target = detect_manifest_path
82
+ source = release_path.join('assets_manifest_backup', File.basename(target))
81
83
  if test "[[ -f #{source} && -f #{target} ]]"
82
84
  execute :cp, source, target
83
85
  else
@@ -89,6 +91,18 @@ namespace :deploy do
89
91
  end
90
92
  end
91
93
 
94
+ def detect_manifest_path
95
+ %w(
96
+ .sprockets-manifest*
97
+ manifest*.*
98
+ ).each do |pattern|
99
+ candidate = release_path.join('public', fetch(:assets_prefix), pattern)
100
+ return capture(:ls, candidate).strip if test(:ls, candidate)
101
+ end
102
+ msg = 'Rails assets manifest file not found.'
103
+ warn msg
104
+ fail Capistrano::FileNotFound, msg
105
+ end
92
106
  end
93
107
  end
94
108
 
@@ -10,7 +10,7 @@ namespace :deploy do
10
10
  if conditionally_migrate && test("diff -q #{release_path}/db/migrate #{current_path}/db/migrate")
11
11
  info '[deploy:migrate] Skip `deploy:migrate` (nothing changed in db/migrate)'
12
12
  else
13
- info '[deploy:migrate] Run `rake db:migrate`' if conditionally_migrate
13
+ info '[deploy:migrate] Run `rake db:migrate`'
14
14
  within release_path do
15
15
  with rails_env: fetch(:rails_env) do
16
16
  execute :rake, "db:migrate"
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Clements
8
8
  - Lee Hambley
9
+ - Kir Shatrov
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-09-01 00:00:00.000000000 Z
13
+ date: 2015-04-18 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: capistrano
@@ -43,6 +44,7 @@ description: Rails specific Capistrano tasks
43
44
  email:
44
45
  - seenmyfate@gmail.com
45
46
  - lee.hambley@gmail.com
47
+ - shatrov@me.com
46
48
  executables: []
47
49
  extensions: []
48
50
  extra_rdoc_files: []
@@ -80,9 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
82
  version: '0'
81
83
  requirements: []
82
84
  rubyforge_project:
83
- rubygems_version: 2.2.1
85
+ rubygems_version: 2.2.2
84
86
  signing_key:
85
87
  specification_version: 4
86
88
  summary: Rails specific Capistrano tasks
87
89
  test_files: []
88
- has_rdoc: