Skip to content

Commit 438eaa6

Browse files
committed
2 parents 631974e + c8a2e76 commit 438eaa6

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

01-terraform-provision-aks-cluster-pipeline.yml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trigger:
2-
- main
2+
- master
33

44
pool:
55
vmImage: 'ubuntu-latest'
@@ -103,3 +103,54 @@ stages:
103103
environmentServiceName: 'terraform-aks-azurerm-svc-con'
104104
commandOptions: '$(Pipeline.Workspace)/terraform-manifests-out/$(DEV_ENVIRONMENT)-$(Build.BuildId).out'
105105
allowTelemetryCollection: false
106+
107+
# Stage-2: Deploy Stages for Dev & QA
108+
# Deployment-2: Deploy QA AKS Cluster
109+
## Step-1: Download Secure File
110+
## Step-2: Terraform Initialize (State Storage to store in Azure Storage Account)
111+
## Step-3: Terraform Plan
112+
## Step-4: Terraform Apply
113+
114+
- deployment: DeployQAAKSCluster
115+
dependsOn: DeployDevAKSCluster
116+
displayName: DeployQAAKSCluster
117+
pool:
118+
vmImage: 'ubuntu-latest'
119+
environment: $(QA_ENVIRONMENT)
120+
strategy:
121+
runOnce:
122+
deploy:
123+
steps:
124+
- task: DownloadSecureFile@1
125+
displayName: Download SSH Key
126+
name: sshkey
127+
inputs:
128+
secureFile: 'aks-terraform-devops-ssh-key-ububtu.pub'
129+
- task: TerraformCLI@0
130+
displayName: Terraform Init
131+
inputs:
132+
command: 'init'
133+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
134+
backendType: 'azurerm'
135+
backendServiceArm: 'terraform-aks-azurerm-svc-con'
136+
backendAzureRmResourceGroupName: 'terraform-storage-rg'
137+
backendAzureRmStorageAccountName: 'terraformstatexlrwdrzs'
138+
backendAzureRmContainerName: 'tfstatefiles'
139+
backendAzureRmKey: 'aks-$(QA_ENVIRONMENT).tfstate'
140+
allowTelemetryCollection: false
141+
- task: TerraformCLI@0
142+
displayName: Terraform Plan
143+
inputs:
144+
command: 'plan'
145+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
146+
environmentServiceName: 'terraform-aks-azurerm-svc-con'
147+
commandOptions: '-var ssh_public_key=$(sshkey.secureFilePath) -var environment=$(QA_ENVIRONMENT) -out $(Pipeline.Workspace)/terraform-manifests-out/$(QA_ENVIRONMENT)-$(Build.BuildId).out'
148+
allowTelemetryCollection: false
149+
- task: TerraformCLI@0
150+
displayName: Terraform Apply
151+
inputs:
152+
command: 'apply'
153+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
154+
environmentServiceName: 'terraform-aks-azurerm-svc-con'
155+
commandOptions: '$(Pipeline.Workspace)/terraform-manifests-out/$(QA_ENVIRONMENT)-$(Build.BuildId).out'
156+
allowTelemetryCollection: false

0 commit comments

Comments
 (0)