Skip to content

Commit

Permalink
[TECH] Documenter la variable d'env SEEDS_CONTEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Oct 31, 2024
2 parents 2fb2bd9 + a225d4b commit adf10d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/db/seeds/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const seed = async function (knex) {
await team1dDataBuilder(databaseBuilder);
}

if (hasToSeed.content) {
if (hasToSeed.contenu) {
logger.info('Seeding : Contenu');
await teamContenuDataBuilder({ databaseBuilder });
}
Expand Down Expand Up @@ -84,7 +84,7 @@ function _buildContextToSeed(params) {
devcomp: true,
acces: true,
junior: true,
content: true,
contenu: true,
certification: true,
evaluation: true,
};
Expand All @@ -95,7 +95,7 @@ function _buildContextToSeed(params) {
devcomp: false,
acces: false,
junior: false,
content: false,
contenu: false,
certification: false,
evaluation: false,
};
Expand All @@ -105,9 +105,9 @@ function _buildContextToSeed(params) {
if (seedContext === 'DEVCOMP') hasToSeed.devcomp = true;
if (seedContext === 'JUNIOR') hasToSeed.junior = true;
if (seedContext === 'ACCES') hasToSeed.acces = true;
if (seedContext === 'CONTENT') hasToSeed.content = true;
if (seedContext === 'CERTIF') hasToSeed.certification = true;
if (seedContext === 'EVAL') hasToSeed.evaluation = true;
if (seedContext === 'CONTENU') hasToSeed.contenu = true;
if (seedContext === 'CERTIFICATION') hasToSeed.certification = true;
if (seedContext === 'EVALUATION') hasToSeed.evaluation = true;
});

return hasToSeed;
Expand Down
12 changes: 12 additions & 0 deletions api/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -1028,3 +1028,15 @@ TEST_IMPORT_STORAGE_BUCKET_NAME=pix-import-test
# type: string
# sample: EMAIL_VALIDATION_DEMAND_TEMPORARY_STORAGE_LIFESPAN=3d
EMAIL_VALIDATION_DEMAND_TEMPORARY_STORAGE_LIFESPAN=3d

# =====
# SEEDS
# =====

# Database seeds environment context
#
# presence: optional
# type: string (any in "PRESCRIPTION", "DEVCOMP", "JUNIOR", "ACCES", "CONTENU", "CERTIFICATION", "EVALUATION")
# default: "PRESCRIPTION|DEVCOMP|JUNIOR|ACCES|CONTENU|CERTIFICATION|EVALUATION"
# sample: SEEDS_CONTEXT="EVALUATION|DEVCOMP"
# SEEDS_CONTEXT="PRESCRIPTION|DEVCOMP|JUNIOR|ACCES|CONTENU|CERTIFICATION|EVALUATION"

0 comments on commit adf10d6

Please sign in to comment.