-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines-inventoryService.yml
More file actions
66 lines (60 loc) · 1.75 KB
/
Copy pathazure-pipelines-inventoryService.yml
File metadata and controls
66 lines (60 loc) · 1.75 KB
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
60
61
62
63
64
65
66
# Docker
trigger:
- master
resources:
- repo: self
variables:
tag: $(Build.BuildId)
containerRegistry: 'dba3f8f5d0df4cb492652988af71367c.azurecr.io'
imageRepository: 'demo/inventory-service'
imagePullSecret: 'regcred'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
displayName: Build an image
inputs:
containerRegistry: 'ACRConnection'
repository: 'demo/inventory-service'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
tags: $(tag)
- upload: manifests
artifact: manifests
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
displayName: Deploy
pool:
vmImage: 'ubuntu-latest'
environment: 'dev.dev'
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@0
displayName: Create imagePullSecret
inputs:
action: 'createSecret'
kubernetesServiceConnection: 'dev-myAKSCluster-dev-1573614110824'
secretType: 'dockerRegistry'
secretName: $(imagePullSecret)
dockerRegistryEndpoint: 'ACRConnection'
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: 'deploy'
kubernetesServiceConnection: 'dev-myAKSCluster-dev-1573614110824'
manifests: |
$(Pipeline.Workspace)/manifests/deployment.yml
$(Pipeline.Workspace)/manifests/service.yml
containers: $(containerRegistry)/$(imageRepository):$(tag)
imagePullSecrets: $(imagePullSecret)