Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating azurePipelines to Generic Handler #400

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
133 changes: 0 additions & 133 deletions pkg/azurePipelines/azurePipelines.go

This file was deleted.

174 changes: 0 additions & 174 deletions pkg/azurePipelines/azurePipelines_test.go

This file was deleted.

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)
Loading
Loading