openminds_deploy 1.0.5.beta → 1.0.5.beta2

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.
@@ -25,13 +25,24 @@ configuration.load do
25
25
  run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
26
26
  end
27
27
  end
28
-
29
28
  after 'deploy:finalize_update', 'dbconfig:link'
30
-
31
29
  after 'deploy:setup', 'dbconfig:copy_database_config'
32
30
 
33
31
  after :deploy, 'deploy:cleanup'
34
32
 
33
+ desc 'Prompts if new migrations are available and runs them if you want to'
34
+ namespace :deploy do
35
+ task :needs_migrations, :roles => :db, :only => {:primary => true} do
36
+ old_rev = capture("cd #{previous_release} && git log --pretty=format:'%H' -n 1 | cat").strip
37
+ new_rev = capture("cd #{latest_release} && git log --pretty=format:'%H' -n 1 | cat").strip
38
+ migrations_changed = capture("cd #{latest_release} && git diff #{old_rev} #{new_rev} --name-only | cat").include?('db/migrate')
39
+ if migrations_changed && Capistrano::CLI.ui.ask("New migrations pending. Enter 'yes' to run db:migrate") == 'yes'
40
+ migrate
41
+ end
42
+ end
43
+ end
44
+ after 'deploy:update_code', 'deploy:needs_migrations'
45
+
35
46
  desc 'Tail application log'
36
47
  task :tail_log, :roles => :app do
37
48
  sudo "tail -f #{shared_path}/log/#{rails_env}.log"
@@ -36,18 +36,4 @@ configuration.load do
36
36
  end
37
37
  end
38
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'
53
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openminds_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5.beta
4
+ version: 1.0.5.beta2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: