Skip to content

Commit b79fdaf

Browse files
authored
Merge pull request #146 from EventTriangle/AZ400-304
AZ400-304. Manage Cloudflare DNS record using Postman and PowerShell
2 parents 3a4315d + b2ec683 commit b79fdaf

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec
2222
- Add integration tests project to auth service
2323
- Create a separate powershell script for build and tag docker images
2424
- Move configure AKS cluster to separate pipeline
25+
- Cloudflare DNS automation using PowerShell in Azure pipelines

build/configure-aks-cluster.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ variables:
2020
- group: Postgres_Rabbit_Connection_Credentials
2121
- group: Terraform_Auto_Tfvars_Json_Transform
2222
- group: AKS_Settings
23+
- group: Cloudflare_configuration
2324
- group: Prefix_Library
2425
- name: System.Debug
2526
value: 'false'
2627

2728
stages:
2829
- template: templates/configure-cluster-stages.yml
2930
parameters:
30-
vmImage: ubuntu-latest
31+
vmImage: windows-latest
3132
environment: aks
3233
workingDirectory: $(System.DefaultWorkingDirectory)/kubernetes
3334
serviceConnection: Azure_Connection
@@ -36,5 +37,7 @@ stages:
3637
namespace: 'event-triangle'
3738
rabbitMqUser: $(library-rabbitmq-user)
3839
rabbitMqPassword: $(library-rabbitmq-password)
40+
cloudflareApiKey: $(cloudflare-api-key)
41+
cloudflareZone: $(cloudflare-zone-name)
3942
transformTargetFiles: |
4043
secrets/connection-secrets.yaml

build/templates/configure-cluster-stages.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
22
- name: vmImage
3+
default: 'windows-latest'
34
type: string
45

56
- name: environment
@@ -34,6 +35,14 @@ parameters:
3435
displayName: 'RabbitMQ Password'
3536
type: string
3637

38+
- name: cloudflareApiKey
39+
displayName: 'Cloudflare API Token'
40+
type: string
41+
42+
- name: cloudflareZone
43+
displayName: 'Zone name of DNS in cloudflare (e.g razumovsky.me)'
44+
type: string
45+
3746
stages:
3847
- stage: 'Configure_AKS_${{ parameters.environment }}'
3948
displayName: 'Configure_AKS_${{ parameters.environment }}'
@@ -133,9 +142,10 @@ stages:
133142
workingDirectory: ${{ parameters.workingDirectory }}
134143

135144
- task: PowerShell@2
136-
displayName: 'Print Public IPs'
145+
displayName: 'Configure Cloudflare DNS'
137146
inputs:
138147
targetType: 'filePath'
139-
filePath: ${{ parameters.workingDirectory }}/scripts/print-ip.ps1
148+
filePath: $(System.DefaultWorkingDirectory)/cloudflare/Main.ps1
149+
arguments: '-ApiToken ${{ parameters.cloudflareApiKey }} -ZoneName ${{ parameters.cloudflareZone }}'
140150
pwsh: true
141-
workingDirectory: ${{ parameters.workingDirectory }}
151+
workingDirectory: '$(System.DefaultWorkingDirectory)/cloudflare'

build/templates/docker-build-push-jobs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ jobs:
175175
publishLocation: 'Container'
176176

177177
- task: PublishBuildArtifacts@1
178+
displayName: 'Publish Manifests'
178179
inputs:
179180
pathToPublish: '$(System.DefaultWorkingDirectory)/kubernetes'
180-
artifactName: k8s-manifests
181+
artifactName: 'k8s-manifests'
182+
publishLocation: 'Container'

0 commit comments

Comments
 (0)