-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
69 lines (58 loc) · 1.78 KB
/
azure-pipelines.yml
File metadata and controls
69 lines (58 loc) · 1.78 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
67
68
69
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'docker-aks-serviceconnection'
containerRegistry: docker-aks-serviceconnection
imageRepository: 'shawon10/webclient-angular-crud'
dockerfilePath: '**/Dockerfile'
tag: '$(Build.BuildNumber)'
resources:
- repo: self
stages:
- stage: Build
displayName: Build Image (Docker)
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Login to Docker Hub
inputs:
command: login
repository: $(imageRepository)
containerRegistry: $(containerRegistry)
- task: Docker@2
displayName: Build an image and push to docker hub
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
- stage: Deploy
displayName: Deploy to Kubernetes
dependsOn: Build
jobs:
- job: Deployment
displayName: Deploy
pool:
vmImage: ubuntu-latest
steps:
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
kubernetesServiceConnection: aks-serviceconnection
action: deploy
manifests: |
./manifests/deployment.yml
./manifests/service.yml
./manifests/ingress.yml
containers: |
$(imageRepository):$(tag)