diff --git a/pkg/fixtures/workflows/azurepipelines/manifests/.pipelines/azure-kubernetes-service.yaml b/pkg/fixtures/workflows/azurepipelines/manifests/.pipelines/azure-kubernetes-service.yaml index c4fd7718d..7bc078848 100644 --- a/pkg/fixtures/workflows/azurepipelines/manifests/.pipelines/azure-kubernetes-service.yaml +++ b/pkg/fixtures/workflows/azurepipelines/manifests/.pipelines/azure-kubernetes-service.yaml @@ -1,22 +1,23 @@ -# Azure Kubernetes Service pipeline -# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service cluster - -variables: - armServiceConnection: testserviceconnection - azureContainerRegistry: myacr.acr.io - containerName: myapp - clusterRg: myrg - acrRg: myrg - clusterName: testcluster - manifestPath: ./manifests - namespace: default - tag: "$(Build.BuildId)" - vmImageName: "ubuntu-latest" - -name: Build and deploy an app to AKS - -trigger: - - main +# Azure Kubernetes Service pipeline +# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service cluster + +variables: + armServiceConnection: testserviceconnection + azureContainerRegistry: myacr.acr.io + containerName: myapp + clusterRg: myrg + acrRg: myrg + clusterName: testcluster + manifestPath: ./manifests + namespace: default + resourceType: Microsoft.ContainerService/fleets + tag: "$(Build.BuildId)" + vmImageName: "ubuntu-latest" + +name: Build and deploy an app to AKS + +trigger: + - main stages: - stage: BuildAndPush @@ -56,5 +57,6 @@ stages: kubernetesCluster: $(clusterName) manifests: $(manifestPath) namespace: $(namespace) + resource-type: $(resourceType) containers: | $(azureContainerRegistry).azurecr.io/$(containerName):$(tag) diff --git a/pkg/handlers/templatetests/workflows_azure_manifest_test.go b/pkg/handlers/templatetests/workflows_azure_manifest_test.go index 988e30bc2..c4e6a34dc 100644 --- a/pkg/handlers/templatetests/workflows_azure_manifest_test.go +++ b/pkg/handlers/templatetests/workflows_azure_manifest_test.go @@ -22,6 +22,7 @@ func TestAzureWorkflowManifestTemplates(t *testing.T) { "CLUSTERRESOURCEGROUP": "myrg", "ACRRESOURCEGROUP": "myrg", "CLUSTERNAME": "testcluster", + "RESOURCETYPE": "Microsoft.ContainerService/fleets", }, }, } diff --git a/template/azurePipelines/manifests/.pipelines/azure-kubernetes-service.yaml b/template/azurePipelines/manifests/.pipelines/azure-kubernetes-service.yaml index 1f963d1c2..cde00a533 100644 --- a/template/azurePipelines/manifests/.pipelines/azure-kubernetes-service.yaml +++ b/template/azurePipelines/manifests/.pipelines/azure-kubernetes-service.yaml @@ -10,6 +10,7 @@ variables: clusterName: {{ .Config.GetVariableValue "CLUSTERNAME" }} manifestPath: {{ .Config.GetVariableValue "MANIFESTPATH" }} namespace: {{ .Config.GetVariableValue "NAMESPACE" }} + resourceType: {{ .Config.GetVariableValue "RESOURCETYPE" }} tag: "$(Build.BuildId)" vmImageName: "ubuntu-latest" @@ -56,6 +57,7 @@ stages: kubernetesCluster: $(clusterName) manifests: $(manifestPath) namespace: $(namespace) + resource-type: $(resourceType) containers: | $(azureContainerRegistry).azurecr.io/$(containerName):$(tag) `}} \ No newline at end of file