Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. require 'pathname'
  3. require 'fileutils'
  4. include FileUtils
  5.  
  6. # path to your application root.
  7. APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
  8.  
  9. def system!(*args)
  10. system(*args) || abort("\n== Command #{args} failed ==")
  11. end
  12.  
  13. chdir APP_ROOT do
  14. system! 'ridgepole -c config/database.yml --apply --dry-run -f Schemafile'
  15.  
  16. puts '------------'
  17. puts 'apply? [y/n]'
  18. puts '------------'
  19.  
  20. case gets.chomp
  21. when 'yes', 'YES', 'y'
  22. system! 'ridgepole -c config/database.yml --apply -f Schemafile'
  23. system! 'ridgepole -c config/database.yml --apply -f Schemafile -E test'
  24. system! 'ridgepole -c config/database.yml --export -o Schemafile'
  25. system! 'bundle exec annotate'
  26. when 'no', 'NO', 'n'
  27. exit 1
  28. else
  29. exit 1
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement