-
-
Save inopinatus/1176444 to your computer and use it in GitHub Desktop.
no maintenance page unless we're migrating. who needs grep?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# no maint page unless migrations are required | |
def conditionally_enable_maintenance_page | |
super if required_downtime_stack? | |
if c.migrate? | |
info "~> testing necessity for migrations & maintenance page" | |
if `cd #{c.release_path} && bundle exec rake db:migrate:status`.scan(/^\s*down/).size > 0 | |
info "~> migrations pending, maintenance page required" | |
super | |
else | |
info "~> no migrations pending, maintenance page not required, migration command cancelled" | |
@cancel_migrations = true | |
end | |
end | |
end | |
def migrate | |
return if @cancel_migrations | |
super | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment