capistrano-deploy-management 0.1.23 → 0.1.24
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.
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'capistrano-deploy-management'
|
4
4
|
s.description = 'Collection of Capistrano recipes for deploying Rails apps into high-performance environments'
|
5
|
-
s.version = '0.1.
|
5
|
+
s.version = '0.1.24'
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ['Dominik Rodler']
|
8
8
|
s.email = ['dominik.rodler@gmail.com']
|
data/changelog.md
CHANGED
@@ -18,39 +18,39 @@ module CapistranoDeployManagement
|
|
18
18
|
# end
|
19
19
|
# end
|
20
20
|
end
|
21
|
-
end
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
desc 'Precompile assets if any assets have changed.'
|
23
|
+
task :lazy_precompile, :roles => :web, :except => { :no_release => true } do
|
24
|
+
current_revision = "cat #{current_path}/REVISION"
|
25
|
+
head_revision = "cat #{latest_release}/REVISION"
|
26
|
+
assets_paths = "#{latest_release}/app/assets/ #{latest_release}/lib/assets/ #{latest_release}/vendor/assets/"
|
28
27
|
|
29
|
-
|
28
|
+
run "svn log -r #{current_revision}:#{head_revision} #{assets_paths}"
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
# if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
|
31
|
+
# run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
|
32
|
+
# else
|
33
|
+
# logger.info "Skipping asset pre-compilation because there were no asset changes"
|
34
|
+
# end
|
35
|
+
end
|
36
|
+
|
37
|
+
# desc 'Precompile assets, but only those that are not precompiled already.'
|
38
|
+
# task :recompile, :roles => :web, :except => { :no_release => true } do
|
39
|
+
# run <<-EOF
|
40
|
+
# export FROM=`[ -f #{current_path}/REVISION ] && (cat #{current_path}/REVISION | perl -pe 's/$/../')` &&
|
41
|
+
# export TO=`cat #{latest_release}/REVISION` &&
|
42
|
+
# echo ${FROM}${TO} &&
|
43
|
+
# cd #{shared_path}/cached-copy &&
|
44
|
+
# git log ${FROM}${TO} -- app/assets vendor/assets | wc -l | egrep '^0$' ||
|
45
|
+
# (
|
46
|
+
# echo "Recompiling assets" &&
|
47
|
+
# cd #{latest_release} &&
|
48
|
+
# source .rvmrc &&
|
49
|
+
# RAILS_ENV=production bundle exec rake assets:precompile --trace
|
50
|
+
# )
|
51
|
+
# EOF
|
35
52
|
# end
|
36
53
|
end
|
37
|
-
|
38
|
-
# desc 'Precompile assets, but only those that are not precompiled already.'
|
39
|
-
# task :recompile, :roles => :web, :except => { :no_release => true } do
|
40
|
-
# run <<-EOF
|
41
|
-
# export FROM=`[ -f #{current_path}/REVISION ] && (cat #{current_path}/REVISION | perl -pe 's/$/../')` &&
|
42
|
-
# export TO=`cat #{latest_release}/REVISION` &&
|
43
|
-
# echo ${FROM}${TO} &&
|
44
|
-
# cd #{shared_path}/cached-copy &&
|
45
|
-
# git log ${FROM}${TO} -- app/assets vendor/assets | wc -l | egrep '^0$' ||
|
46
|
-
# (
|
47
|
-
# echo "Recompiling assets" &&
|
48
|
-
# cd #{latest_release} &&
|
49
|
-
# source .rvmrc &&
|
50
|
-
# RAILS_ENV=production bundle exec rake assets:precompile --trace
|
51
|
-
# )
|
52
|
-
# EOF
|
53
|
-
# end
|
54
54
|
end
|
55
55
|
|
56
56
|
after 'deploy:update', 'deploy:assets:refresh_cache'
|