-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrating azurePipelines to Generic Handler (#400)
Co-authored-by: Brandon Foley <brfole@microsoft.com>
- Loading branch information
Showing
10 changed files
with
204 additions
and
335 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
pkg/fixtures/workflows/azurepipelines/kustomize/.pipelines/azure-kubernetes-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Azure Kubernetes Service (AKS) pipeline with Kustomize | ||
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service cluster | ||
|
||
variables: | ||
armServiceConnection: testserviceconnection | ||
azureContainerRegistry: myacr.acr.io | ||
containerName: myapp | ||
acrRg: myrg | ||
clusterRg: myrg | ||
clusterName: testcluster | ||
kustomizePath: ./overlays/production | ||
namespace: default | ||
tag: "$(Build.BuildId)" | ||
vmImageName: "ubuntu-latest" | ||
|
||
trigger: | ||
- main | ||
|
||
name: Build and deploy an app to AKS | ||
|
||
stages: | ||
- stage: BuildAndPush | ||
displayName: Build stage | ||
jobs: | ||
- job: BuildAndPush | ||
displayName: Build and push image | ||
pool: | ||
vmImage: $(vmImageName) | ||
steps: | ||
- task: AzureCLI@2 | ||
displayName: Build and push image to Azure Container Registry | ||
inputs: | ||
azureSubscription: $(armServiceConnection) | ||
scriptType: "bash" | ||
scriptLocation: "inlineScript" | ||
inlineScript: | | ||
az acr build --image $1.azurecr.io/$2:$3 --registry $1 -g $4 . | ||
arguments: "$(azureContainerRegistry) $(containerName) $(tag) $(acrRg)" | ||
|
||
- stage: Deploy | ||
displayName: Deploy stage | ||
dependsOn: BuildAndPush | ||
jobs: | ||
- job: Deploy | ||
displayName: Deploy to AKS using Kustomize | ||
pool: | ||
vmImage: $(vmImageName) | ||
steps: | ||
- task: KubernetesManifest@1 | ||
displayName: Bake Kustomize manifests | ||
inputs: | ||
action: 'bake' | ||
kustomizationPath: $(kustomizePath) | ||
renderType: 'kustomize' | ||
name: 'bake' | ||
|
||
- task: KubernetesManifest@1 | ||
displayName: Deploy baked manifests to Kubernetes cluster | ||
inputs: | ||
action: 'deploy' | ||
connectionType: 'azureResourceManager' | ||
azureSubscriptionConnection: $(armServiceConnection) | ||
azureResourceGroup: $(clusterRg) | ||
kubernetesCluster: $(clusterName) | ||
namespace: $(namespace) | ||
manifests: $(bake.manifestsBundle) | ||
containers: | | ||
$(azureContainerRegistry).azurecr.io/$(containerName):$(tag) |
Oops, something went wrong.