Skip to content

Commit 88ea4c4

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

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

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

Lines changed: 11 additions & 5 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/[email protected]
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,10 +161,10 @@ 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
166+
dictionary-deploy-lambda:
167+
- ab-testing/dictionary-deploy-lambda/dist/lambda.zip
162168
admin/ab-testing:
163169
- ab-testing/frontend/output/ab-tests.html
164170
cdk.out:

ab-testing/cdk/bin/cdk.ts

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

33-
const abTestingArtifactDeployment = "ab-testing-dictionary-artifact";
33+
const abTestingArtifactDeployment = "ab-testing-config-artifacts";
3434

35-
deployments.set(abTestingArtifactDeployment, {
36-
app: abTestingArtifactDeployment,
37-
contentDirectory: "dictionary-deploy-lambda/artifacts",
35+
deployments.set("config/ab-testing", {
36+
app: "ab-testing-config-artifact",
37+
contentDirectory: "ab-testing-config-artifacts",
3838
type: "aws-s3",
3939
regions: new Set(["eu-west-1"]),
4040
stacks: new Set(["frontend"]),
@@ -46,9 +46,9 @@ deployments.set(abTestingArtifactDeployment, {
4646
},
4747
});
4848

49-
deployments.set("ab-testing-ui-artifact", {
49+
deployments.set("admin/ab-testing", {
5050
app: "ab-testing-ui-artifact",
51-
contentDirectory: "admin/ab-testing",
51+
contentDirectory: "ab-testing-ui-artifact",
5252
type: "aws-s3",
5353
regions: new Set(["eu-west-1"]),
5454
stacks: new Set(["frontend"]),
@@ -60,8 +60,9 @@ deployments.set("ab-testing-ui-artifact", {
6060
},
6161
});
6262

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

6768
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)