Skip to content

Commit 4100710

Browse files
authored
feat: setup stg-alt2 and clean up old pre-iac scripts (#8837)
* feat: remove deprecated pre-iac scripts * feat: add cd scripts for stg-alt2 * feat: add stg-alt2 to serverless config * feat: provide sam bucket
1 parent 2119773 commit 4100710

File tree

12 files changed

+151
-211
lines changed

12 files changed

+151
-211
lines changed

.github/workflows/aws-deploy-scanner.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ on:
44
push:
55
branches-ignore:
66
- stg
7-
- staging-alt2
87
- stg-alt
8+
- stg-alt2
99
- stg-alt3
1010
- uat
1111
pull_request:
1212
types: [opened, reopened]
1313
branches-ignore:
1414
- stg
15-
- staging-alt2
1615
- stg-alt
16+
- stg-alt2
1717
- stg-alt3
1818
- uat
1919

.github/workflows/deploy-eb.yml

Lines changed: 0 additions & 140 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy FormSG app to stg-alt2
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- stg-alt2
11+
12+
jobs:
13+
deploy:
14+
name: Deploy
15+
uses: ./.github/workflows/deploy-ecs.yml
16+
with:
17+
gha-environment: 'stg-alt2'
18+
# Environment configuration
19+
environment: 'stg-alt2'
20+
environment-site-name: 'stg-alt2'
21+
app-version: ${{ github.sha }}
22+
app-url: 'https://stg-alt2.form.gov.sg'
23+
react-app-form-sg-sdk-mode: 'staging'
24+
# AWS configuration
25+
aws-region: 'ap-southeast-1'
26+
ecr-repository: 'formsg'
27+
# ECS configuration
28+
ecs-cpu: 1024
29+
ecs-memory: 2048
30+
ecs-cluster-name: 'formsg-stg-alt2-ecs'
31+
ecs-service-name: 'formsg-stg-alt2-ecs-service'
32+
ecs-task-definition: 'formsg-stg-alt2-ecs'
33+
ecs-task-definition-path: 'deploy/ecs-task-definition.json'
34+
ecs-container-name: 'formsg-app'
35+
# CodeDeploy configuration
36+
codedeploy-application: 'formsg-stg-alt2-ecs-app'
37+
codedeploy-appspec-path: deploy/appspec.yml
38+
codedeploy-deployment-group: 'formsg-stg-alt2-ecs-dg'
39+
# Datadog config
40+
dd-env: 'stg-alt2'
41+
secrets:
42+
# AWS credentials and configuration
43+
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
44+
cicd-role: ${{ secrets.IAC_AWS_CI_ROLE_TO_ASSUME }}
45+
# Monitoring and analytics configuration
46+
ga-tracking-id: ${{ secrets.GA_TRACKING_ID }}
47+
dd-rum-app-id: ${{ secrets.DD_RUM_APP_ID }}
48+
dd-rum-client-token: ${{ secrets.DD_RUM_CLIENT_TOKEN }}
49+
dd-sample-rate: ${{ secrets.DD_SAMPLE_RATE }}
50+
DD_API_KEY: ${{ secrets.DD_API_KEY }}
51+
S3_STATIC_ASSETS_BUCKET_NAME: ${{ secrets.S3_STATIC_ASSETS_BUCKET_NAME }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy PDF Generator Lambda to stg-alt2
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
permissions:
8+
id-token: write
9+
contents: read
10+
11+
on:
12+
push:
13+
branches:
14+
- stg-alt2
15+
16+
jobs:
17+
deploy-pdf-gen-lambda:
18+
name: Deploy PDF Generator Lambda
19+
uses: ./.github/workflows/deploy-pdf-gen-lambda.yml
20+
with:
21+
gha-environment: 'stg-alt2'
22+
checkoutBranch: 'stg-alt2'
23+
environment: 'stg-alt2'
24+
secrets:
25+
cicd-role: ${{ secrets.IAC_AWS_CI_ROLE_TO_ASSUME }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy Virus Scanner GuardDuty to stg-alt2
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
permissions:
8+
id-token: write
9+
contents: read
10+
11+
on:
12+
push:
13+
branches:
14+
- stg-alt2
15+
16+
jobs:
17+
deploy-scanner-guardduty:
18+
name: Deploy Scanner GuardDuty
19+
uses: ./.github/workflows/aws-deploy-scanner-guardduty-iac.yml
20+
with:
21+
checkoutBranch: 'stg-alt2'
22+
gha-environment: 'stg-alt2'
23+
environment: 'stg-alt2'
24+
provisionedConcurrency: 1
25+
secrets:
26+
cicd-role: ${{ secrets.IAC_AWS_CI_ROLE_TO_ASSUME }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy Legacy Virus Scanner to stg-alt2
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
permissions:
8+
id-token: write
9+
contents: read
10+
11+
on:
12+
push:
13+
branches:
14+
- stg-alt2
15+
# For legacy virus scanner: schedule builds for 12:00AM GMT+8 everyday to get latest ClamAV virus definitions
16+
schedule:
17+
- cron: '0 16 * * *'
18+
19+
jobs:
20+
deploy-scanner:
21+
name: Deploy Scanner
22+
uses: ./.github/workflows/aws-deploy-scanner-legacy.yml
23+
with:
24+
checkoutBranch: 'stg-alt2'
25+
gha-environment: 'stg-alt2'
26+
environment: 'stg-alt2'
27+
provisionedConcurrency: 1
28+
secrets:
29+
cicd-role: ${{ secrets.IAC_AWS_CI_ROLE_TO_ASSUME }}

.github/workflows/playwright.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ on:
44
push:
55
branches-ignore:
66
- stg
7-
- staging-alt2
87
- stg-alt
8+
- stg-alt2
99
- stg-alt3
1010
- uat
1111
pull_request:
1212
types: [opened, reopened]
1313
branches-ignore:
1414
- stg
15-
- staging-alt2
1615
- stg-alt
16+
- stg-alt2
1717
- stg-alt3
1818
- uat
1919

serverless/pdf-gen-sparticuz/samconfig.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ stg-alt:
2626
confirm_changeset: true
2727
parameter_overrides: Environment=stg-alt
2828

29+
stg-alt2:
30+
deploy:
31+
parameters:
32+
stack_name: pdf-gen-sparticuz-stg-alt2
33+
s3_bucket: pdf-gen-lambda-code-zip-stg-alt2-8ea8a44 # Created by pulumi in formsg-infra to store AWS SAM builds.
34+
region: ap-southeast-1
35+
capabilities: CAPABILITY_IAM # Allows the deployment to create IAM resources
36+
s3_prefix: stg-alt2
37+
image_repositories: []
38+
disable_rollback: false # Rolls back to previous version if the deployment fails
39+
confirm_changeset: true
40+
parameter_overrides: Environment=stg-alt2
41+
2942
stg-alt3:
3043
deploy:
3144
parameters:

0 commit comments

Comments
 (0)