openminds_deploy 1.0.4 → 1.0.5.beta

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,15 +26,14 @@ configuration.load do
26
26
  end
27
27
  end
28
28
 
29
- after 'deploy:finalize_update' do
30
- dbconfig.link
31
- end
29
+ after 'deploy:finalize_update', 'dbconfig:link'
32
30
 
33
- after 'deploy:setup' do
34
- dbconfig.copy_database_config
35
- end
31
+ after 'deploy:setup', 'dbconfig:copy_database_config'
32
+
33
+ after :deploy, 'deploy:cleanup'
36
34
 
37
- after :deploy do
38
- deploy.cleanup
35
+ desc 'Tail application log'
36
+ task :tail_log, :roles => :app do
37
+ sudo "tail -f #{shared_path}/log/#{rails_env}.log"
39
38
  end
40
39
  end
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'bundler/capistrano'
3
3
  rescue LoadError
4
- $stderr.puts <<INSTALL
4
+ $stderr.puts <<-INSTALL
5
5
  The openminds_deploy/rails3 recipe requires bundler's deploy task. For this to work we need the bundler gem (>=1.0.0):
6
6
  gem install bundler
7
7
  INSTALL
@@ -13,11 +13,41 @@ configuration.load do
13
13
  namespace :openminds do
14
14
  task :check_rails3_compat do
15
15
  if roles[:app].servers.any? {|server| %w(zuurstof.openminds.be kobalt.openminds.be koper.openminds.be zink.openminds.be).include?(server.host) }
16
- abort "This server is not Rails 3 compatible. Mail support@openminds.be to move your account to a compatible server."
16
+ abort 'This server is not Rails 3 compatible. Mail support@openminds.be to move your account to a compatible server.'
17
17
  end
18
18
  end
19
19
  end
20
20
 
21
- before "deploy:update_code", "openminds:check_rails3_compat"
22
- before "deploy:setup", "openminds:check_rails3_compat"
21
+ before 'deploy:update_code', 'openminds:check_rails3_compat'
22
+ before 'deploy:setup', 'openminds:check_rails3_compat'
23
+
24
+ namespace :deploy do
25
+ namespace :assets do
26
+ task :precompile, :roles => :web, :except => {:no_release => true} do
27
+ old_rev = capture("cd #{previous_release} && git log --pretty=format:'%H' -n 1 | cat").strip
28
+ new_rev = capture("cd #{latest_release} && git log --pretty=format:'%H' -n 1 | cat").strip
29
+ assets_changed = capture("cd #{latest_release} && git diff #{old_rev} #{new_rev} --name-only | cat").include?('asset')
30
+ gemfile_changed = capture("cd #{latest_release} && git diff #{old_rev} #{new_rev} --name-only | cat").include?('Gemfile.lock')
31
+ if assets_changed || (gemfile_changed && Capistrano::CLI.ui.ask("Gemfile changed. Enter 'yes' to precomple assets?") == 'yes')
32
+ run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
33
+ else
34
+ logger.info 'Skipping asset precompilation because there were no asset changes.'
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ desc 'Prompts if new migrations are available and runs them if you want to'
41
+ namespace :deploy do
42
+ task :needs_migrations, :roles => :db, :only => {:primary => true} do
43
+ old_rev = capture("cd #{previous_release} && git log --pretty=format:'%H' -n 1 | cat").strip
44
+ new_rev = capture("cd #{latest_release} && git log --pretty=format:'%H' -n 1 | cat").strip
45
+ migrations_changed = capture("cd #{latest_release} && git diff #{old_rev} #{new_rev} --name-only | cat").include?('db/migrate')
46
+ if migrations_changed && Capistrano::CLI.ui.ask("New migrations pending. Enter 'yes' to run db:migrate") == 'yes'
47
+ migrate
48
+ end
49
+ end
50
+ end
51
+
52
+ after 'deploy:update_code', 'deploy:needs_migrations'
23
53
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openminds_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
5
- prerelease:
4
+ version: 1.0.5.beta
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan De Poorter
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2011-09-28 00:00:00.000000000Z
15
+ date: 2012-04-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: capistrano
19
- requirement: &70334746892720 !ruby/object:Gem::Requirement
19
+ requirement: !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,7 +24,12 @@ dependencies:
24
24
  version: '2.5'
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *70334746892720
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '2.5'
28
33
  description: The most commonly used tasks in Capistrano recipes
29
34
  email: devel@openminds.be
30
35
  executables: []
@@ -38,7 +43,6 @@ files:
38
43
  - lib/openminds_deploy/passenger.rb
39
44
  - lib/openminds_deploy/rails3.rb
40
45
  - lib/openminds_deploy/svn.rb
41
- - lib/openminds_deploy/version.rb
42
46
  - lib/openminds_deploy.rb
43
47
  - README.rdoc
44
48
  homepage: http://www.openminds.be
@@ -57,12 +61,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
61
  required_rubygems_version: !ruby/object:Gem::Requirement
58
62
  none: false
59
63
  requirements:
60
- - - ! '>='
64
+ - - ! '>'
61
65
  - !ruby/object:Gem::Version
62
- version: '0'
66
+ version: 1.3.1
63
67
  requirements: []
64
68
  rubyforge_project:
65
- rubygems_version: 1.8.10
69
+ rubygems_version: 1.8.21
66
70
  signing_key:
67
71
  specification_version: 3
68
72
  summary: Common capistrano recipes for Openminds applications
@@ -1,3 +0,0 @@
1
- module OpenmindsDeploy
2
- VERSION = '1.0.4'
3
- end