Skip to content

Commit

Permalink
chore(recette1new): essai de délpoiement sur l'env recette1new
Browse files Browse the repository at this point in the history
  • Loading branch information
FaXaq committed Nov 19, 2024
1 parent ceb0fa9 commit 07b09bc
Show file tree
Hide file tree
Showing 10 changed files with 920 additions and 721 deletions.
2 changes: 1 addition & 1 deletion .bin/scripts/release-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
options:
- production
- recette
- recette1new
- recette2
app_version:
description: app version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions .infra/env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1,586 changes: 874 additions & 712 deletions .infra/vault/vault.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fileignoreconfig:
- filename: .infra/files/configs/mongodb/seed.gpg
checksum: b1fa159bb2036a835b4138843b48043eca4ea374bcbb710ba4593bd39b1dfec1
- filename: .infra/vault/vault.yml
checksum: 1a0f3c5c1167ada755726a8ab6cc36fffe359e2ea3cab0c0e3a5dacf8ce6d3b9
checksum: 43b02b95166534a32c1f52128ba502726d588b911a1572277cb2835c82472fcd
- filename: README.md
checksum: 00ac991f0b2746c5a5ffa14e2b3c5427b739c0d952aa3730efe1f234ac1fc3ca
- filename: server/.env.test
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion docker-bake.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"recette": {
"targets": ["server", "ui-recette"]
},
"recette1new": {
"targets": ["server", "ui-recette1new"]
},
"recette2": {
"targets": ["server", "ui-recette2"]
},
Expand Down Expand Up @@ -50,7 +53,7 @@
"ui": {
"inherits": ["common"],
"matrix": {
"ENV": ["production", "recette", "recette2", "local"]
"ENV": ["production", "recette", "recette1new", "recette2", "local"]
},
"name": "ui-${ENV}",
"args": {
Expand Down
5 changes: 4 additions & 1 deletion server/src/config.ts
Original file line number Diff line number Diff line change
@@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/core/usecases/home/home.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
}),
},
},
Expand Down
25 changes: 24 additions & 1 deletion ui/config.public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -58,6 +58,26 @@ function getRecettePublicConfig(): PublicConfig {
};
}

function getRecette1newPublicConfig(): PublicConfig {
const host = "recette-1-new.orion.inserjeunes.incubateur.net";

return {
sentry: {
dsn: "https://[email protected]/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";

Expand Down Expand Up @@ -128,6 +148,7 @@ function getEnv(): PublicConfig["env"] {
switch (env) {
case "production":
case "recette":
case "recette1new":
case "recette2":
case "local":
return env;
Expand All @@ -142,6 +163,8 @@ function getPublicConfig(): PublicConfig {
return getProductionPublicConfig();
case "recette":
return getRecettePublicConfig();
case "recette1new":
return getRecette1newPublicConfig();
case "recette2":
return getRecette2PublicConfig();
case "local":
Expand Down

0 comments on commit 07b09bc

Please sign in to comment.