Skip to content

Commit 399de07

Browse files
committed
fix: Set environment variables required to run the app
1 parent c1e962d commit 399de07

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,24 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering CODE
21382138
"Ref": "RiffRaffDeploymentId",
21392139
},
21402140
},
2141+
"Environment": [
2142+
{
2143+
"Name": "NODE_ENV",
2144+
"Value": "production",
2145+
},
2146+
{
2147+
"Name": "GU_STAGE",
2148+
"Value": "CODE",
2149+
},
2150+
{
2151+
"Name": "GU_APP",
2152+
"Value": "tag-page-rendering",
2153+
},
2154+
{
2155+
"Name": "GU_STACK",
2156+
"Value": "frontend",
2157+
},
2158+
],
21412159
"Essential": true,
21422160
"Image": {
21432161
"Fn::Join": [

dotcom-rendering/cdk/lib/renderingStack.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,22 @@ export class RenderingCDKStack extends CDKStack {
295295
}),
296296
});
297297

298+
if (imageIdentifier != null) {
299+
const ecsEnvVars: Record<string, string> = {
300+
NODE_ENV: 'production',
301+
GU_STAGE: stage,
302+
GU_APP: guApp,
303+
GU_STACK: guStack,
304+
};
305+
306+
for (const [key, value] of Object.entries(ecsEnvVars)) {
307+
app.ecsService?.taskDefinition.defaultContainer?.addEnvironment(
308+
key,
309+
value,
310+
);
311+
}
312+
}
313+
298314
/**
299315
* The default Node server keep alive timeout is 5 seconds
300316
* @see https://nodejs.org/api/http.html#serverkeepalivetimeout

0 commit comments

Comments
 (0)