capistrano-stretcher-rails 0.1.0 → 0.2.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/capistrano-stretcher-rails.gemspec +1 -1
- data/lib/capistrano/stretcher/tasks/rails.rake +32 -10
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8c3a6ded406df00ec1ceedf13e6373b47a23549
|
4
|
+
data.tar.gz: 73d3694d8cafbdd2ec81d210f22e778ccf748f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8434bdb90e5b603b79afb8ac8b5063e0df82aa76405b3ff3a56e43571f39db48058e7c2963247fe331975e715b24b59b70258fd3d6d3d71ae6711c55ab4f269
|
7
|
+
data.tar.gz: d83e0acd082bc21f66d7efb64111a582e89143be33334752e99a44564ad54bfe7d1276349050db3d4e9e378f950c15276b1e2e3c68e23bfde0bb39fea3cdbaef
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano-stretcher-rails"
|
7
|
-
spec.version = "0.
|
7
|
+
spec.version = "0.2.0"
|
8
8
|
spec.authors = ["SHIBATA Hiroshi", "Uchio Kondo"]
|
9
9
|
spec.email = ["hsbt@ruby-lang.org", "udzura@udzura.jp"]
|
10
10
|
|
@@ -1,5 +1,11 @@
|
|
1
|
+
# Original source about assets precompile: https://github.com/capistrano-plugins/capistrano-faster-assets/blob/master/lib/capistrano/tasks/faster_assets.rake
|
2
|
+
|
1
3
|
namespace :stretcher do
|
2
4
|
set :exclude_dirs, fetch(:exclude_dirs) << "vendor/bundle" << "public/assets"
|
5
|
+
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
|
6
|
+
|
7
|
+
class PrecompileRequired < StandardError;
|
8
|
+
end
|
3
9
|
|
4
10
|
def local_bundle_path
|
5
11
|
@_local_bundle_path ||= fetch(:local_bundle_path, "vendor/bundle")
|
@@ -17,16 +23,33 @@ namespace :stretcher do
|
|
17
23
|
on application_builder_roles do
|
18
24
|
within local_build_path do
|
19
25
|
with rails_env: fetch(:rails_env) do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
26
|
+
begin
|
27
|
+
checkout_dirs = capture(:ls, '-xr', local_checkout_path)
|
28
|
+
latest_path = "#{local_checkout_path}/#{checkout_dirs.split[0]}"
|
29
|
+
previous_path = "#{local_checkout_path}/#{checkout_dirs.split[1]}"
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
raise PrecompileRequired unless previous_path
|
32
|
+
|
33
|
+
execute :ls, "#{previous_path}/public/assets" rescue raise PrecompileRequired
|
34
|
+
|
35
|
+
fetch(:assets_dependencies).each do |dep|
|
36
|
+
latest = "#{latest_path}/#{dep}"
|
37
|
+
previous = "#{previous_path}/#{dep}"
|
38
|
+
next if [latest, previous].map{|d| test "[ -e #{d} ]"}.uniq == [false]
|
39
|
+
|
40
|
+
execute :diff, '-Nqr', latest, previous rescue raise PrecompileRequired
|
41
|
+
end
|
42
|
+
|
43
|
+
info('Skipping asset precompile, no asset diff found')
|
44
|
+
|
45
|
+
execute :cp, '-r', "#{previous_path}/public/assets", "#{latest_path}/public/"
|
46
|
+
|
47
|
+
rescue PrecompileRequired
|
48
|
+
execute :rm, '-rf', 'public/assets'
|
49
|
+
execute :bundle, :exec, :rake, 'assets:precompile'
|
50
|
+
execute :cp, '-r', 'public/assets', "#{latest_path}/public/"
|
51
|
+
end
|
52
|
+
end
|
30
53
|
end
|
31
54
|
end
|
32
55
|
end
|
@@ -34,4 +57,3 @@ end
|
|
34
57
|
|
35
58
|
after 'stretcher:checkout_local', 'stretcher:bundle'
|
36
59
|
before 'stretcher:create_tarball', 'stretcher:asset_precompile'
|
37
|
-
after 'stretcher:cleanup_dirs', 'stretcher:cleanup_precompiled_assets'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-stretcher-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIBATA Hiroshi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-05-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano-stretcher
|
@@ -89,9 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.6.11
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: rails specific tasks for capistrano-stretcher
|
96
96
|
test_files: []
|
97
|
-
has_rdoc:
|