Skip to content

Commit

Permalink
add mobile-purchases-feast to ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbjacobson committed Mar 4, 2024
1 parent 7181db8 commit 33f7204
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ jobs:
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
aws-region: eu-west-1

- name: Generate CFN templates using GuCDK
run: bash ./script/cdk-synth.sh

- name: Upload to Riff-Raff
uses: guardian/actions-riff-raff@v2
with:
projectName: Mobile::mobile-purchases
buildNumberOffset: 2740
configPath: riff-raff.yaml
contentDirectories: |
mobile-purchases-feast-cloudformation:
- cdk/cdk.out/MobilePurchasesFeast-CODE.json
- cdk/cdk.out/MobilePurchasesFeast-PROD.json
mobile-purchases-cloudformation:
- cloudformation.yaml
mobile-purchases-dynamo-cloudformation:
Expand Down
6 changes: 3 additions & 3 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "source-map-support/register";
import { GuRoot } from "@guardian/cdk/lib/constructs/root";
import { MobilePurchases } from "../lib/mobile-purchases";
import { MobilePurchasesFeast } from "../lib/mobile-purchases-feast";

const app = new GuRoot();
new MobilePurchases(app, "MobilePurchases-euwest-1-CODE", { stack: "mobile", stage: "CODE", env: { region: "eu-west-1" } });
new MobilePurchases(app, "MobilePurchases-euwest-1-PROD", { stack: "mobile", stage: "PROD", env: { region: "eu-west-1" } });
new MobilePurchasesFeast(app, "MobilePurchasesFeast-CODE", { stack: "mobile", stage: "CODE", env: { region: "eu-west-1" } });
new MobilePurchasesFeast(app, "MobilePurchasesFeast-PROD", { stack: "mobile", stage: "PROD", env: { region: "eu-west-1" } });
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { App } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";
import { MobilePurchases } from "./mobile-purchases";
import { MobilePurchasesFeast } from "./mobile-purchases-feast";

describe("The MobilePurchases stack", () => {
describe("The MobilePurchasesFeast stack", () => {
it("matches the snapshot", () => {
const app = new App();
const stack = new MobilePurchases(app, "MobilePurchases", { stack: "mobile", stage: "TEST" });
const stack = new MobilePurchasesFeast(app, "MobilePurchasesFeast", { stack: "mobile", stage: "TEST" });
const template = Template.fromStack(stack);
expect(template.toJSON()).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { GuStackProps } from "@guardian/cdk/lib/constructs/core";
import { GuStack } from "@guardian/cdk/lib/constructs/core";
import type { App } from "aws-cdk-lib";

export class MobilePurchases extends GuStack {
export class MobilePurchasesFeast extends GuStack {
constructor(scope: App, id: string, props: GuStackProps) {
super(scope, id, props);
}
Expand Down
7 changes: 7 additions & 0 deletions riff-raff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ templates:
prefixStack: false

deployments:
mobile-purchases-feast-cloudformation:
type: cloud-formation
parameters:
templateStagePaths:
CODE: MobilePurchasesFeast-CODE.template.json
PROD: MobilePurchasesFeast-PROD.template.json

mobile-purchases-cloudformation:
type: cloud-formation
parameters:
Expand Down
14 changes: 14 additions & 0 deletions script/cdk-synth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e
set -x

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ROOT_DIR="${DIR}/.."
cd "$ROOT_DIR/cdk"

yarn install --frozen-lockfile
yarn tsc
yarn lint
yarn test
yarn synth

0 comments on commit 33f7204

Please sign in to comment.