Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Validate system status prior to migrating #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nils-werner
Copy link
Contributor

No description provided.

@nils-werner
Copy link
Contributor Author

This doesn't really prevent errors from happening but rather stops the deployment when there are validation errors. This check will happen prior to changing the database etc.

You could also implement a rollback mechanism using

    try:
        run('git pull origin master')
        run(pip + ' install -r requirements.txt')
        run(python + ' {{ project_name }}/manage.py validate --settings={{ project_name }}.settings.production')
    except SystemExit:
        run('git reset --hard HEAD@{1}')

this will pull the changes, try validating the system and, if it fails, undo the pull. I didn't implement this as it will not undo failing migrations etc. and currently only gives a false sense of security. :-)

@davecranwell
Copy link
Contributor

Hi Nils,

This isn't pertinent to the content of this pull request specifically, but I need to point out that wagtail's main repo now contains its own project template. This specific repo is mainly now for internal Torchbox use. It's effectively not for public consumption. It was for the public, but We rethought things, stripped it back a little, made it less opinionated, and added it to wagtail's main repo here: https://github.com/torchbox/wagtail/tree/master/wagtail/project_template

Any changes you're suggesting here, while extremely useful, probably ought to be made in the main wagtail repo.

@kaedroho
Copy link
Contributor

@nils-werner
Thanks, this is a really good idea.

Could we use the manage.py check command instead? As this template is for starting Django 1.7 projects and validate has been deprecated in favour of check.

@davecranwell Yes, this template is aimed at Torchbox projects but it is still open to the public to use just as before. We only decided to create a separate template for wagtail start as we didn't want the default one to be so opinionated.

@davecranwell
Copy link
Contributor

Ah ok, my point still stands though. Your changes may need to occur in two places. Perhaps not this specific pr, but perhaps #8 and any others you're due to submit

@kaedroho kaedroho force-pushed the master branch 3 times, most recently from 86aa145 to 5b6d11e Compare February 26, 2015 11:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants