forked from MicrosoftDocs/azure-pipelines-canary-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-acrpush-cd.yml
60 lines (50 loc) · 1.74 KB
/
demo-acrpush-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pipeline triggers on each new container push to ACR, which has a feature-* tag
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'acr-connection'
imagePullSecret: 'aksdevops3acr1234-auth'
# Agent VM image name
vmImageName: 'ubuntu-latest'
resources:
containers:
- container: acrpushdemocontainer
type: ACR
azureSubscription: armsubscriptionconnection
resourceGroup: IaCFasthack-dev
registry: gitteiacappdevacr
repository: acrpush-demo
trigger:
tags:
include:
- feature-*
stages:
- stage: DeployDev
displayName: Deploy feature to dev
jobs:
- deployment: Deploydev
displayName: Deploy dev
pool:
vmImage: $(vmImageName)
environment: 'aksacrpushdemo.acrpushdemodev'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: KubernetesManifest@0
displayName: Create imagePullSecret
inputs:
action: createSecret
secretName: $(imagePullSecret)
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
manifests: |
$(Build.SourcesDirectory)/**/manifests/deployment.yml
$(Build.SourcesDirectory)/**/manifests/service.yml
imagePullSecrets: |
$(imagePullSecret)
containers: |
$(resources.container.acrpushdemocontainer.registry)/$(resources.container.acrpushdemocontainer.repository):$(resources.container.acrpushdemocontainer.tag)