forked from containers101/cf-example-vote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
65 lines (54 loc) · 1.49 KB
/
azure-pipelines.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
# Deploy to Azure Kubernetes Service
# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'b8d72312-ee7a-49b9-8b99-77f27fefb42d'
imageRepository: 'shashbanexamplevote'
containerRegistry: 'atulmakshelm.azurecr.io'
dockerfilePath: '**/Dockerfile'
tag: '$(Build.BuildId)'
# Kubernetes Namespace
k8sNamespace: 'default'
imagePullSecret: 'atulmakshelm538a-auth'
kubeconn: 'kodeAKS-default'
stages:
- stage: Build
displayName: Build stage
dependsOn: []
condition: and(succeeded(), startsWith(variables['BuildBranch'], 'Build'))
jobs:
- job: Build
displayName: Build job
steps:
- checkout: none
- script: echo HEllow wporls
- stage: Deploy
displayName: Deploy stage
dependsOn: []
condition: and(succeeded(), not(startsWith(variables['BuildBranch'], 'Build')))
jobs:
- job: Fail
steps:
- script: Write-Error "abc"
- job: Pass
steps:
- script: echo "pass"
- stage: Deploy2
displayName: Deploy2 stage
dependsOn: Deploy
condition: always()
jobs:
- deployment: Deploy
condition: succeeded()
displayName: Deploy
environment: 'shashbanexamplevote'
strategy:
runOnce:
deploy:
steps:
- script: echo "clean"