-
Notifications
You must be signed in to change notification settings - Fork 23
Portable database health check #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| #!/bin/bash | ||
| until echo -e 'import sys\nfrom django.db import connection\ntry:\n connection.ensure_connection()\nexcept Exception:\n sys.exit(1)\n' | /var/www/venv/bin/python ansible_wisdom/manage.py shell | ||
| do | ||
| echo "Waiting until the database is ready..." | ||
| sleep 5 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to factor this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both ways seem equivalent to me. |
||
| done | ||
|
|
||
| /var/www/venv/bin/python ansible_wisdom/manage.py migrate --noinput | ||
|
|
||
| cd ansible_wisdom/ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using this format which makes python code easier on the eyes? https://gist.github.com/jameswnl/b6e6038aafef2dc3ae67e59b20180599
(This is from automation-analytics which is in GitLab. cleaned and dropped there for easier access)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's a good idea. Updated.