Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/DeployBranchPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
TERRAFORM_STATE_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
6 changes: 2 additions & 4 deletions .github/workflows/DeployEverything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ on:
required: true
CLOUDFLARE_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true

env:
AZURE_WEBAPP_PACKAGE_PATH: PocketDDD.Server.WebAPI/publish
Expand Down Expand Up @@ -48,9 +46,9 @@ jobs:
- name: Setup terraform
uses: hashicorp/setup-terraform@v4
- run: |
terraform init -backend-config="key=${{ inputs.env }}.terraform.tfstate"
# terraform init -backend-config="key=${{ inputs.env }}.terraform.tfstate"

terraform apply -auto-approve -var-file ../tfvars/${{ inputs.env }}.tfvars -var 'cloudflare_account_id=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}'
# terraform apply -auto-approve -var-file ../tfvars/${{ inputs.env }}.tfvars
env:
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
ARM_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/DeployMainBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- 'main'
- 'fixProdDeployment'
- 'russ-prod-fixes'

jobs:
deploy_to_production:
Expand All @@ -17,4 +17,3 @@ jobs:
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
TERRAFORM_STATE_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
7 changes: 6 additions & 1 deletion PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.Configuration["apiUrl"]!) });
builder.Services.AddMudServices();
builder.Services.AddFluxor(o => o.ScanAssemblies(typeof(Program).Assembly).UseReduxDevTools());
builder.Services.AddFluxor(o =>
{
o.ScanAssemblies(typeof(Program).Assembly);
if (builder.HostEnvironment.IsDevelopment())
o.UseReduxDevTools();
});
builder.Services.AddBlazoredLocalStorage();

if (builder.Configuration.GetValue<bool>("fakeBackend") == false)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ From the `terraform` directory run init, plan, then apply if happy with the chan
```
cd ./terraform

terraform init -backend-config="dev.terraform.tfstate"
terraform init -backend-config='key="dev.terraform.tfstate"'
terraform plan -var-file ../tfvars/dev.tfvars
terraform apply -var-file ../tfvars/dev.tfvars
```
8 changes: 6 additions & 2 deletions terraform/blazor_client.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ data "cloudflare_zone" "dns_zone" {

resource "cloudflare_dns_record" "cname_record" {
zone_id = data.cloudflare_zone.dns_zone.id
name = local.subdomain
name = "${local.subdomain}.dddsouthwest.com"
content = azurerm_static_web_app.blazor-client.default_host_name
type = "CNAME"
ttl = 1 # 1 = automatic (proxied)
proxied = true # Disable Cloudflare proxy, Azure can handle SSL
proxied = false # Disable Cloudflare proxy, Azure can handle SSL
comment = "Blazor client custom domain - SSL handled by Cloudflare and Azure auto-provisioned certificate"

lifecycle {
ignore_changes = [ proxied ]
}
}

resource "azurerm_static_web_app_custom_domain" "custom_domain" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.10.0"
required_version = ">= 1.13.4"

backend "azurerm" {
resource_group_name = "pocketddd-terraform-state"
Expand Down
5 changes: 0 additions & 5 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,3 @@ variable "client_sku_size" {
nullable = false
type = string
}

variable "cloudflare_account_id" {
nullable = false
type = string
}
26 changes: 13 additions & 13 deletions tfvars/Production.tfvars
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
env = "production"
sql_db_sku = "Basic"
sql_max_storage = "2"
api_app_service_sku = "B1"
api_always_on = false
client_sku_tier = "Free"
client_sku_size = "Free"
region = "UK West"
# sql_db_sku = "Basic"
# sql_max_storage = "2"
# api_app_service_sku = "B1"
# api_always_on = false
# client_sku_tier = "Free"
# client_sku_size = "Free"

# Real prod values
# env = "prod"
# sql_db_sku = "S0"
# sql_max_storage = "10"
# api_app_service_sku = "B1"
# api_always_on = true
# client_sku_tier = "Standard"
# client_sku_size = "Standard"
sql_db_sku = "S0"
sql_max_storage = "10"
api_app_service_sku = "B1"
api_always_on = true
client_sku_tier = "Standard"
client_sku_size = "Standard"
Loading