feat: Ajout de la case à cocher pour l'environement test
This commit is contained in:
parent
c0a0fda9c2
commit
398d0f6957
|
@ -62,6 +62,8 @@ steps:
|
||||||
- npm run fetchData
|
- npm run fetchData
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run build
|
- npm run build
|
||||||
|
environment:
|
||||||
|
NODE_ENV: 'production'
|
||||||
|
|
||||||
- name: deploy on s3
|
- name: deploy on s3
|
||||||
image: minio/mc
|
image: minio/mc
|
||||||
|
@ -152,8 +154,8 @@ steps:
|
||||||
- npm run fetchData
|
- npm run fetchData
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run build
|
- npm run build
|
||||||
- apk add --no-cache jq
|
environment:
|
||||||
- echo $(cat src/data.json | jq -c '[.[0]]') > src/data.json
|
NODE_ENV: 'test'
|
||||||
|
|
||||||
- name: deploy on s3
|
- name: deploy on s3
|
||||||
image: minio/mc
|
image: minio/mc
|
||||||
|
|
|
@ -48,9 +48,12 @@ async function fetchScoresData() {
|
||||||
.map((item) => `fields[]=${item}`)
|
.map((item) => `fields[]=${item}`)
|
||||||
.join("&")}`;
|
.join("&")}`;
|
||||||
let scores = (await fetchJSONApi(url)).data;
|
let scores = (await fetchJSONApi(url)).data;
|
||||||
if (process.env.NODE_ENV != "staging") {
|
if (process.env.NODE_ENV == "production") {
|
||||||
console.log("Suppresion des scores avec le mode brouillon en production");
|
console.log("Suppresion des scores avec le mode brouillon en production");
|
||||||
scores = scores.filter((score) => !score.draft);
|
scores = scores.filter((score) => !score.draft);
|
||||||
|
} else if (process.env.NODE_ENV == "test") {
|
||||||
|
console.log("Suppresion des scores sans l'environnement test");
|
||||||
|
scores = scores.filter((score) => score.env_test);
|
||||||
}
|
}
|
||||||
await fs.writeFile("./src/data.json", JSON.stringify(scores), "utf8");
|
await fs.writeFile("./src/data.json", JSON.stringify(scores), "utf8");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue