Skip to content

Commit

Permalink
feat: ele-6855 add preview deploy environment (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: Darren Arbon <[email protected]>
  • Loading branch information
darren-arbon and darrenarbon authored Jun 26, 2023
1 parent bf41354 commit 846ce58
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/talis-cdk-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Helper constants to allow us to map and reference our deployment environments
| BUILD | Environments spun up for running builds |
| STAGING | Staging environment |
| PRODUCTION | Production Environment |
| ONDEMAND | On-Demand Environment |
| PREVIEW | Preview Environment |

### TalisRegions

Expand Down
1 change: 1 addition & 0 deletions lib/talis-cdk-stack/talis-cdk-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class TalisCdkStack extends Stack {
case TalisDeploymentEnvironment.STAGING:
return RemovalPolicy.SNAPSHOT;
case TalisDeploymentEnvironment.PRODUCTION:
case TalisDeploymentEnvironment.PREVIEW:
return RemovalPolicy.RETAIN;
default:
return RemovalPolicy.RETAIN;
Expand Down
1 change: 1 addition & 0 deletions lib/talis-cdk-stack/talis-deployment-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum TalisDeploymentEnvironment {
STAGING = "staging",
PRODUCTION = "production",
ONDEMAND = "ondemand",
PREVIEW = "preview",
}
7 changes: 7 additions & 0 deletions test/infra/talis-cdk-stack/talis-cdk-stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ describe("Talis CDK Stack", () => {
[TalisDeploymentEnvironment.TEST, cdk.RemovalPolicy.DESTROY],
[TalisDeploymentEnvironment.STAGING, cdk.RemovalPolicy.SNAPSHOT],
[TalisDeploymentEnvironment.PRODUCTION, cdk.RemovalPolicy.RETAIN],
[TalisDeploymentEnvironment.PREVIEW, cdk.RemovalPolicy.RETAIN],
[TalisDeploymentEnvironment.ONDEMAND, cdk.RemovalPolicy.RETAIN],
])(
"Environment %s should have removal policy of %s",
(environment, expected) => {
Expand Down Expand Up @@ -194,6 +196,11 @@ describe("Talis CDK Stack", () => {
region: TalisRegion.EU,
expectedTfsService: "depot-eu",
},
{
devEnvironment: TalisDeploymentEnvironment.PREVIEW,
region: TalisRegion.EU,
expectedTfsService: "depot-preview-eu",
},
];
testcases.forEach((testcase) => {
test(`given app='depot', AWS props.env.region='${testcase.region}' and devEnvironment='${testcase.devEnvironment}' then tfs-service='${testcase.expectedTfsService}'`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ describe("Talis Deployment Environments", () => {
[TalisDeploymentEnvironment.TEST, "test"],
[TalisDeploymentEnvironment.STAGING, "staging"],
[TalisDeploymentEnvironment.PRODUCTION, "production"],
[TalisDeploymentEnvironment.ONDEMAND, "ondemand"],
[TalisDeploymentEnvironment.PREVIEW, "preview"],
])(
"Deployment environment %s should be defined as %s",
(environment, expected) => {
Expand Down

0 comments on commit 846ce58

Please sign in to comment.