Skip to content

Commit

Permalink
fix HostedZoneName
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushAgrawal-A2 committed Dec 22, 2024
1 parent deaa275 commit 0a995cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/preview-cloudformation-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy CloudFormation Stack for Preview Branch

on:
pull_request:
types: [opened, reopened]
types: [opened, synchronize, reopened]

concurrency:
group: pr-${{ github.event.pull_request.number }}-deploy-cloudformation
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2204

env:
STACK_NAME: preview-pr-${{ github.event.pull_request.number }}
STACK_NAME: pr-${{ github.event.pull_request.number }}
STACK_PARAMS: >-
ParameterKey=LicenseKey,ParameterValue=5a32bd8a-409e-4733-8846-1868c568a813
ParameterKey=ImageTag,ParameterValue=pr-${{ github.event.pull_request.number }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview-publish-images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Docker Images for Preview Branches
name: Build and Publish Images to ECR - Preview

on:
pull_request:
Expand All @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true

jobs:
build_images:
publish_images:
permissions:
contents: read

Expand Down
15 changes: 6 additions & 9 deletions infra/aws-cloudformation/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Parameters:
Default: "latest"

Mappings:
EnvironmentConfig:
Preview:
DomainName: "quadratic-preview.com"
RegionMap:
us-west-2:
AMI: "ami-05134c8ef96964280" # Example AMI for us-west-2 (Ubuntu 20.04)
Expand Down Expand Up @@ -132,15 +129,15 @@ Resources:
chmod +x /quadratic-selfhost/login.sh

# Run Quadratic initialization
curl -sSf https://raw.githubusercontent.com/quadratichq/quadratic-selfhost/main/init.sh -o init.sh && bash -i init.sh ${LicenseKey} ${ImageTag}.${!FindInMap [EnvironmentConfig, Preview, DomainName]}
curl -sSf https://raw.githubusercontent.com/quadratichq/quadratic-selfhost/main/init.sh -o init.sh && bash -i init.sh ${LicenseKey} ${ImageTag}.quadratic-preview.com

DnsRecords:
Type: AWS::Route53::RecordSet
DeletionPolicy: Delete
UpdateReplacePolicy: Delete
Properties:
HostedZoneName: !Sub "${!FindInMap [EnvironmentConfig, Preview, DomainName]}."
Name: !Sub "${ImageTag}.${!FindInMap [EnvironmentConfig, Preview, DomainName]}"
HostedZoneName: "quadratic-preview.com."
Name: !Sub "${ImageTag}.quadratic-preview.com"
Type: A
TTL: 300
ResourceRecords:
Expand All @@ -151,8 +148,8 @@ Resources:
DeletionPolicy: Delete
UpdateReplacePolicy: Delete
Properties:
HostedZoneName: !Sub "${!FindInMap [EnvironmentConfig, Preview, DomainName]}."
Name: !Sub "*.${ImageTag}.${!FindInMap [EnvironmentConfig, Preview, DomainName]}"
HostedZoneName: "quadratic-preview.com."
Name: !Sub "*.${ImageTag}.quadratic-preview.com"
Type: A
TTL: 300
ResourceRecords:
Expand Down Expand Up @@ -230,4 +227,4 @@ Resources:
Outputs:
DomainRecord:
Description: "Url of the selfhosted instance"
Value: !Sub "${ImageTag}.${!FindInMap [EnvironmentConfig, Preview, DomainName]}"
Value: !Sub "${ImageTag}.quadratic-preview.com"

0 comments on commit 0a995cc

Please sign in to comment.