Skip to content

Commit e883016

Browse files
committed
more riff-raff tweaks
1 parent 18755d3 commit e883016

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

.github/workflows/ab-testing-ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ jobs:
7272
- name: Build Lambda
7373
run: pnpm build
7474

75+
- name: Zip app artifact
76+
run: |
77+
cd dist
78+
zip -r lambda.zip .
79+
zip -j lambda.zip ../package.json
80+
7581
- name: Save build
7682
uses: actions/upload-artifact@v5
7783
with:
7884
name: ab-testing-lambda-build
79-
path: ab-testing/dictionary-deploy-lambda/dist
85+
path: ab-testing/dictionary-deploy-lambda/dist/lambda.zip
8086

8187
ui-ci:
8288
name: UI CI
@@ -139,7 +145,7 @@ jobs:
139145
uses: actions/download-artifact@v6.0.0
140146
with:
141147
name: ab-testing-lambda-build
142-
path: ab-testing/dictionary-deploy-lambda/dist
148+
path: ab-testing/dictionary-deploy-lambda/dist/lambda.zip
143149

144150
- name: CDK Test
145151
run: pnpm cdk:test
@@ -155,11 +161,11 @@ jobs:
155161
projectName: dotcom:ab-testing
156162
configPath: ab-testing/cdk.out/riff-raff.yaml
157163
contentDirectories: |
158-
ab-testing:
164+
ab-testing-config-artifacts:
159165
- ab-testing/dist
160-
ab-testing-dictionary-deploy-lambda:
161-
- ab-testing/dictionary-deploy-lambda/dist
162-
admin/ab-testing:
166+
ab-testing-deploy:
167+
- ab-testing/dictionary-deploy-lambda/dist/lambda.zip
168+
ab-testing-ui-artifact:
163169
- ab-testing/frontend/output/ab-tests.html
164170
cdk.out:
165171
- ab-testing/cdk.out

ab-testing/cdk/bin/cdk.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ const {
3030
riffRaffYaml: { deployments },
3131
} = riffRaff;
3232

33-
const abTestingArtifactDeployment = "ab-testing-dictionary-artifact";
34-
35-
deployments.set(abTestingArtifactDeployment, {
36-
app: abTestingArtifactDeployment,
37-
contentDirectory: "dictionary-deploy-lambda/artifacts",
33+
deployments.set("config/ab-testing", {
34+
app: "ab-testing-config-artifact",
35+
contentDirectory: "ab-testing-config-artifacts",
3836
type: "aws-s3",
3937
regions: new Set(["eu-west-1"]),
4038
stacks: new Set(["frontend"]),
@@ -46,9 +44,9 @@ deployments.set(abTestingArtifactDeployment, {
4644
},
4745
});
4846

49-
deployments.set("ab-testing-ui-artifact", {
47+
deployments.set("admin/ab-testing", {
5048
app: "ab-testing-ui-artifact",
51-
contentDirectory: "admin/ab-testing",
49+
contentDirectory: "ab-testing-ui-artifact",
5250
type: "aws-s3",
5351
regions: new Set(["eu-west-1"]),
5452
stacks: new Set(["frontend"]),
@@ -60,8 +58,9 @@ deployments.set("ab-testing-ui-artifact", {
6058
},
6159
});
6260

61+
// We need the test artifacts in place before deploying the lambda that uses them
6362
deployments
64-
.get(`lambda-update-eu-west-1-frontend-${appName}`)
65-
?.dependencies?.push(abTestingArtifactDeployment);
63+
.get(`cfn-eu-west-1-frontend-dictionary-deploy-lambda`)
64+
?.dependencies?.push("config/ab-testing");
6665

6766
riffRaff.synth();

ab-testing/dictionary-deploy-lambda/src/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { fetchDictionaryArtifact } from "./fetch-artifact.ts";
44
const ARTIFACT_BUCKET_NAME = process.env.ARTIFACT_BUCKET_NAME ?? "";
55
const STAGE = process.env.STAGE ?? "CODE";
66

7-
const CONFIG_PREFIX = `/${STAGE}/config/ab-tests`;
7+
const CONFIG_PREFIX = `/${STAGE}/config/ab-testing`;
88

99
type ServiceInfo = {
1010
activeVersion: { number: number };

0 commit comments

Comments
 (0)