From 2b696f2965d9dbd8923f650463fce91eaf1acf21 Mon Sep 17 00:00:00 2001 From: Marin Date: Mon, 18 Nov 2024 18:02:13 +0100 Subject: [PATCH] =?UTF-8?q?chore(recette1new):=20essai=20de=20d=C3=A9lpoie?= =?UTF-8?q?ment=20sur=20l'env=20recette1new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bin/scripts/release-app.sh | 2 +- .github/workflows/_deploy.yml | 1 + .github/workflows/release.yml | 4 +-- .infra/env.ini | 7 ++++++ .talismanrc | 2 +- docker-bake.json | 5 +++- server/src/config.ts | 5 +++- .../modules/core/usecases/home/home.route.ts | 2 +- ui/config.public.ts | 25 ++++++++++++++++++- 9 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.bin/scripts/release-app.sh b/.bin/scripts/release-app.sh index d774c948b..740ae0bc2 100755 --- a/.bin/scripts/release-app.sh +++ b/.bin/scripts/release-app.sh @@ -11,4 +11,4 @@ fi readonly next_version="${1}" readonly mode=${2:-$defaultMode} -"$ROOT_DIR/.bin/scripts/build-images.sh" $next_version $mode production recette recette2 +"$ROOT_DIR/.bin/scripts/build-images.sh" $next_version $mode production recette recette1new recette2 diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml index 74423a8db..a61538be2 100644 --- a/.github/workflows/_deploy.yml +++ b/.github/workflows/_deploy.yml @@ -9,6 +9,7 @@ on: options: - production - recette + - recette1new - recette2 app_version: description: app version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d4df8fc7..2e74b42a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,10 +114,10 @@ jobs: concurrency: group: "deploy-${{ github.workflow }}-${{ github.ref }}" needs: ["release"] - name: Deploy ${{ needs.release.outputs.VERSION }} on recette2 + name: Deploy ${{ needs.release.outputs.VERSION }} on recette1new uses: "./.github/workflows/_deploy.yml" with: - environment: recette2 + environment: recette1new app_version: ${{ needs.release.outputs.VERSION }} secrets: DEPLOY_SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }} diff --git a/.infra/env.ini b/.infra/env.ini index bd93a84bc..4e289577b 100644 --- a/.infra/env.ini +++ b/.infra/env.ini @@ -19,6 +19,13 @@ dns_name=recette-1.{{domain_name}}.inserjeunes.incubateur.net host_name={{product_name}}-recette-1 env_type=recette +[recette1new] +91.134.6.195 +[recette1new:vars] +dns_name=recette-1-new.{{domain_name}}.inserjeunes.incubateur.net +host_name={{product_name}}-recette-1-new +env_type=recette1new + [recette2] 91.134.19.45 [recette2:vars] diff --git a/.talismanrc b/.talismanrc index 593cd1e10..e75fd476d 100644 --- a/.talismanrc +++ b/.talismanrc @@ -58,7 +58,7 @@ fileignoreconfig: - filename: ui/app/(wrapped)/statistiques/page.tsx checksum: 573be5ad333d02b3969e61ec8a4860c161af648abb752a3a22b35d5f37bc6bd1 - filename: ui/config.public.ts - checksum: ced0c1ea7757396482b010bd1d684de054358c901ade6c01e4992ead7ec1a385 + checksum: e30b1f644d49ab09b3ad2d815a6d4b183eddda321164a0d67fbdead45457b254 - filename: ui/src/config.public.ts checksum: b13b0a1f3d9590d335062a88e76609c40ba790129e481f7e5c25fbdab6840617 - filename: ui/src/utils/generateUri.ts diff --git a/docker-bake.json b/docker-bake.json index 8f0fdc63d..cdf98c214 100644 --- a/docker-bake.json +++ b/docker-bake.json @@ -13,6 +13,9 @@ "recette": { "targets": ["server", "ui-recette"] }, + "recette1new": { + "targets": ["server", "ui-recette1new"] + }, "recette2": { "targets": ["server", "ui-recette2"] }, @@ -50,7 +53,7 @@ "ui": { "inherits": ["common"], "matrix": { - "ENV": ["production", "recette", "recette2", "local"] + "ENV": ["production", "recette", "recette1new", "recette2", "local"] }, "name": "ui-${ENV}", "args": { diff --git a/server/src/config.ts b/server/src/config.ts index ca6ac90d8..96917790a 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -1,6 +1,9 @@ import env from "env-var"; -const environement = env.get("ENV").required().asEnum(["local", "recette", "recette2", "production", "test"]); +const environement = env + .get("ENV") + .required() + .asEnum(["local", "recette", "recette1new", "recette2", "production", "test"]); const publicUrl = env.get("PUBLIC_URL").required().asString(); // if (process.env.NODE_ENV === "test") { diff --git a/server/src/modules/core/usecases/home/home.route.ts b/server/src/modules/core/usecases/home/home.route.ts index 5b8e987b5..489c89089 100644 --- a/server/src/modules/core/usecases/home/home.route.ts +++ b/server/src/modules/core/usecases/home/home.route.ts @@ -12,7 +12,7 @@ export const homeRoute = (server: Server) => { 200: z.object({ name: z.string(), version: z.string(), - env: z.enum(["local", "recette", "recette2", "production", "test"]), + env: z.enum(["local", "recette", "recette1new", "recette2", "production", "test"]), }), }, }, diff --git a/ui/config.public.ts b/ui/config.public.ts index 7415a6d7e..ce2cc95a2 100644 --- a/ui/config.public.ts +++ b/ui/config.public.ts @@ -9,7 +9,7 @@ export interface PublicConfig { host: string; baseUrl: string; apiEndpoint: string; - env: "local" | "recette" | "recette2" | "production"; + env: "local" | "recette" | "recette1new" | "recette2" | "production"; version: string; productMeta: { brandName: "orion"; @@ -58,6 +58,26 @@ function getRecettePublicConfig(): PublicConfig { }; } +function getRecette1newPublicConfig(): PublicConfig { + const host = "recette-1-new.orion.inserjeunes.incubateur.net"; + + return { + sentry: { + dsn: "https://87a205584ce84a5ab3f207e60ff3674d@sentry.incubateur.net/140", + enabled: true, + }, + crisp: { + token: "no-token", + }, + host, + baseUrl: `https://${host}`, + env: "recette1new", + apiEndpoint: `https://${host}/api`, + version: getVersion(), + productMeta: getProductMeta(), + }; +} + function getRecette2PublicConfig(): PublicConfig { const host = "recette-2.orion.inserjeunes.incubateur.net"; @@ -128,6 +148,7 @@ function getEnv(): PublicConfig["env"] { switch (env) { case "production": case "recette": + case "recette1new": case "recette2": case "local": return env; @@ -142,6 +163,8 @@ function getPublicConfig(): PublicConfig { return getProductionPublicConfig(); case "recette": return getRecettePublicConfig(); + case "recette1new": + return getRecette1newPublicConfig(); case "recette2": return getRecette2PublicConfig(); case "local":