capistrano-deploy-management 0.1.22 → 0.1.23

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.22'
5
+ s.version = '0.1.23'
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
@@ -1,4 +1,7 @@
1
- - 0.1.21 / 0.1.21
1
+ - 0.1.23
2
+ work in progress: only precompile assets if any assets have changed
3
+
4
+ - 0.1.21 / 0.1.22
2
5
  attempt to speed up bundle install using --local flag // reverted, because some gems are OS-specific and make bundle install fail
3
6
 
4
7
  - 0.1.19 / 0.1.20
@@ -6,9 +6,9 @@ module CapistranoDeployManagement
6
6
  use_recipe :rails
7
7
 
8
8
  namespace :deploy do
9
- namespace :assets do
9
+ namespace :assets, :roles => :web do
10
10
  desc 'Clear application cache (e.g. Memcached).'
11
- task :refresh_cache, roles: :app do
11
+ task :refresh_cache, roles: :web do
12
12
  run "cd #{current_path} && rake cache:clear RAILS_ENV=#{rails_env}"
13
13
  # Requires this rake task: (include here!?)
14
14
  # namespace :cache do
@@ -19,6 +19,38 @@ module CapistranoDeployManagement
19
19
  # end
20
20
  end
21
21
  end
22
+
23
+ desc 'Precompile assets if any assets have changed.'
24
+ task :lazy_precompile, :roles => :web, :except => { :no_release => true } do
25
+ current_revision = "cat #{current_path}/REVISION"
26
+ head_revision = "cat #{latest_release}/REVISION"
27
+ assets_paths = "#{latest_release}/app/assets/ #{latest_release}/lib/assets/ #{latest_release}/vendor/assets/"
28
+
29
+ run "svn log -r #{current_revision}:#{head_revision} #{assets_paths}"
30
+
31
+ # if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
32
+ # run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
33
+ # else
34
+ # logger.info "Skipping asset pre-compilation because there were no asset changes"
35
+ # end
36
+ 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
22
54
  end
23
55
 
24
56
  after 'deploy:update', 'deploy:assets:refresh_cache'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-deploy-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: