Created
March 5, 2018 19:11
-
-
Save garthhumphreys/a3c505b5918a6ccebd9b2cc03bf40e26 to your computer and use it in GitHub Desktop.
Fab maintenance-mode script
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
# One for renaming the toggle file from 'maintenance-mode-off' to 'maintenance-mode-on', this will turn on the maintenance mode the next time someone refreshes the page or clicks on a link | |
def mm_on(): | |
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'): | |
run('mv maintenance-mode-off maintenance-mode-on') | |
# And this command turns the maintenance mode off, again by renaming the "toggle file". | |
def mm_off(): | |
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'): | |
run('mv maintenance-mode-on maintenance-mode-off') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment