Repository navigation
Conversation
Contributor
Ça va être la merdasse pour redéployer |
tut-tuuut
reviewed
Nov 30, 2021
Comment on lines
+55
to
+56
| @mock.patch.dict(os.environ, {"INIT_ORGA_NAME": "Donjons et Siphons"}) | ||
| @mock.patch.dict(os.environ, {"INIT_ADMIN_USERNAME": "mario.brossse@world.fr"}) |
tut-tuuut
reviewed
Nov 30, 2021
| @mock.patch.dict(os.environ, {"INIT_ORGA_NAME": "Donjons et Siphons"}) | ||
| @mock.patch.dict(os.environ, {"INIT_ADMIN_USERNAME": "mario.brossse@world.fr"}) | ||
| @mock.patch.dict(os.environ, {"INIT_ADMIN_PASSWORD": "PEACHforEVER"}) | ||
| @mock.patch.dict(os.environ, {"INIT_TOKEN": "12345"}) |
Contributor
There was a problem hiding this comment.
Suggested change
| @mock.patch.dict(os.environ, {"INIT_TOKEN": "12345"}) | |
| @mock.patch.dict(os.environ, {"INIT_TOKEN": "123456"}) |
Six chiffres le token, sinon tu vas avoir des problèmes
tut-tuuut
reviewed
Nov 30, 2021
| init_token = os.environ.get("INIT_TOKEN", None) | ||
|
|
||
| models = [Aidant, Organisation, StaticToken, StaticDevice] | ||
| if any([model.objects.exists() for model in models]): |
tut-tuuut
reviewed
Nov 30, 2021
| if any([model.objects.exists() for model in models]): | ||
| return None | ||
|
|
||
| if all([init_token, init_orga_name, init_admin_username, init_admin_password]): |
tut-tuuut
approved these changes
Nov 30, 2021
mrjmad
force-pushed
the
jmad_init_database_with_venv
branch
from
November 30, 2021 09:43
88b2e13 to
42a7535
Compare
|
|
||
| dependencies = [ | ||
| ("aidants_connect_web", "0078_auto_20211122_1813"), | ||
| ("otp_static", "__latest__"), |
Contributor
There was a problem hiding this comment.
Wah… Je connaissais pas __latest__. C'top bien !
christophehenry
approved these changes
Nov 30, 2021
mrjmad
force-pushed
the
jmad_init_database_with_venv
branch
from
December 1, 2021 14:59
42a7535 to
61a1b87
Compare
mrjmad
force-pushed
the
jmad_init_database_with_venv
branch
from
December 3, 2021 09:35
61a1b87 to
3adf520
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌮 Objectif
On ajoute une migration qui remplie les bases vide avec une orga, un user et un token statique uniquement si les conditions suivantes sont respectées :
j'ai presque envie que l'on ne merge jamais cette PR et qu'on déploie simplement une fois la branche lorsque nécessaire.
🔍 Implémentation
🏕 Amélioration continue
(optionnel) Documentation, commandes à lancer, variables d'environment, etc
🖼️ Images
(optionnel) Une ou plusieurs captures d'écran