From 022049bf8a92e4ef86cbbfe3f92ab414b6946214 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Sat, 27 Jul 2024 14:49:26 +0200 Subject: [PATCH 1/5] fix: add a site id to razzle api path --- package.json | 3 ++- src/plone.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2560e91..1d3ba71 100644 --- a/package.json +++ b/package.json @@ -136,5 +136,6 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".", + "packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e" } diff --git a/src/plone.ts b/src/plone.ts index 97db3ee..18dae58 100644 --- a/src/plone.ts +++ b/src/plone.ts @@ -17,6 +17,7 @@ export interface PloneBaseOptions { } export interface PloneOptions { readonly version?: string; + readonly site_id?: string; readonly backend?: PloneBaseOptions; readonly frontend?: PloneBaseOptions; readonly imagePullSecrets?: string[]; @@ -30,6 +31,10 @@ export class Plone extends Construct { constructor(scope: Construct, id: string, options: PloneOptions = {}) { super(scope, id); + // ------------------------------------------------------------------------ + // General + const site_id = options.site_id ?? 'Plone'; + // ------------------------------------------------------------------------ // Backend const backend = options.backend ?? {}; @@ -134,7 +139,7 @@ export class Plone extends Construct { var frontendEnvironment = frontend.environment ?? new kplus.Env([], {}); if (frontendEnvironment.variables.RAZZLE_INTERNAL_API_PATH === undefined) { // connect with backend service - frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}`)); + frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}/${site_id}`)); } // Deployment From f0214eb77c188003af0e080ff3570e367fbc975e Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Sat, 27 Jul 2024 14:51:06 +0200 Subject: [PATCH 2/5] fix test output --- test/__snapshots__/plone.test.ts.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/__snapshots__/plone.test.ts.snap b/test/__snapshots__/plone.test.ts.snap index 6b6de6a..f922c08 100644 --- a/test/__snapshots__/plone.test.ts.snap +++ b/test/__snapshots__/plone.test.ts.snap @@ -151,7 +151,7 @@ exports[`defaults 1`] = ` "env": [ { "name": "RAZZLE_INTERNAL_API_PATH", - "value": "http://app-plone-backend-service-c8efef4c:8080", + "value": "http://app-plone-backend-service-c8efef4c:8080/Plone", }, ], "envFrom": [], @@ -391,7 +391,7 @@ exports[`defaults-with-pdps 1`] = ` "env": [ { "name": "RAZZLE_INTERNAL_API_PATH", - "value": "http://app-plone_with_pdbs-backend-service-c819541f:8080", + "value": "http://app-plone_with_pdbs-backend-service-c819541f:8080/Plone", }, ], "envFrom": [], From 430006a0b7695b785b1da7672d414d8f774c9104 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Sat, 27 Jul 2024 14:55:32 +0200 Subject: [PATCH 3/5] fix package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 997ed67..0120fa7 100644 --- a/package.json +++ b/package.json @@ -136,6 +136,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".", - "packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e" + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." } From 11dc94d9d4dbea603ef000cd400169e82f5f2d70 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Sat, 27 Jul 2024 14:57:36 +0200 Subject: [PATCH 4/5] camelCase Du olles Kamel --- src/plone.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plone.ts b/src/plone.ts index 18dae58..6806333 100644 --- a/src/plone.ts +++ b/src/plone.ts @@ -17,7 +17,7 @@ export interface PloneBaseOptions { } export interface PloneOptions { readonly version?: string; - readonly site_id?: string; + readonly siteId?: string; readonly backend?: PloneBaseOptions; readonly frontend?: PloneBaseOptions; readonly imagePullSecrets?: string[]; @@ -33,7 +33,7 @@ export class Plone extends Construct { // ------------------------------------------------------------------------ // General - const site_id = options.site_id ?? 'Plone'; + const siteId = options.siteId ?? 'Plone'; // ------------------------------------------------------------------------ // Backend @@ -139,7 +139,7 @@ export class Plone extends Construct { var frontendEnvironment = frontend.environment ?? new kplus.Env([], {}); if (frontendEnvironment.variables.RAZZLE_INTERNAL_API_PATH === undefined) { // connect with backend service - frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}/${site_id}`)); + frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}/${siteId}`)); } // Deployment From 52db5eeef6ab00fc91e1eff7a597b3cb827c41c0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 27 Jul 2024 12:59:02 +0000 Subject: [PATCH 5/5] chore: self mutation Signed-off-by: github-actions --- API.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/API.md b/API.md index 149ce84..344c003 100644 --- a/API.md +++ b/API.md @@ -261,6 +261,7 @@ const ploneOptions: PloneOptions = { ... } | backend | PloneBaseOptions | *No description.* | | frontend | PloneBaseOptions | *No description.* | | imagePullSecrets | string[] | *No description.* | +| siteId | string | *No description.* | | version | string | *No description.* | --- @@ -295,6 +296,16 @@ public readonly imagePullSecrets: string[]; --- +##### `siteId`Optional + +```typescript +public readonly siteId: string; +``` + +- *Type:* string + +--- + ##### `version`Optional ```typescript