-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-1.yml
73 lines (65 loc) · 1.71 KB
/
azure-pipelines-1.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Bootcamp-Weight-app-k8s-helm
trigger:
- master
- feature/*
resources:
- repo: self
# Continuous Integration Process..
stages:
- stage: Build
displayName: Install Docker-Build and push stage
jobs:
- job: Build
displayName: Build
pool:
name: "CI-agents"
steps:
- task: Docker@2
displayName: Build and push image
inputs:
containerRegistry: 'docker-registry'
repository: 'WeightTrackerApp'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
- task: HelmInstaller@0
inputs:
helmVersion: '3.0.0'
installKubectl: true
- task: HelmDeploy@0
inputs:
command: 'package'
chartVersion: '$(Build.BuildId)'
chartPath: '**/charts/app-chart'
destination: '/home/ubuntu/charts'
- stage: DeployToStaging
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
displayName: Deploy staging stage
jobs:
- deployment: Deploy
displayName: Deploy to staging
pool:
name: "CI-agents"
environment: 'staging.default'
variables:
- group: "Staging-variables"
strategy:
runOnce:
deploy:
steps:
- template: templates/kubernetes-helm-cd-template.yaml
- stage: DeployToProduction
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
displayName: Deploy production stage
jobs:
- deployment: Deploy
displayName: Deploy to production
pool:
name: "CI-agents"
environment: 'production.default'
variables:
- group: "Production-variables"
strategy:
runOnce:
deploy:
steps:
- template: templates/kubernetes-helm-cd-template.yaml