-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipeline-template.yml
118 lines (114 loc) · 3.4 KB
/
azure-pipeline-template.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Template parameters
parameters:
- name: stage
type: string
values:
- 'dev'
- 'prod'
default: 'dev'
variables:
${{ if eq(parameters.stage, 'prod') }}:
tagVersion: '$(Build.BuildId)'
tagLatest: 'latest'
postfix: ''
${{ if eq(parameters.stage, 'dev') }}:
tagVersion: '$(Build.BuildId)-dev'
tagLatest: 'latest-dev'
postfix: '-dev'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: build_skipvalidation
displayName: Build skipvalidation
steps:
- task: Docker@2
displayName: Build and push skipvalidation-image to container registry
inputs:
command: buildAndPush
repository: skipvalidation
dockerfile: batch/skip_validation/Dockerfile
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tagVersion)
$(tagLatest)
- job: build_basicmetadata
displayName: Build basicmetadata
steps:
- task: Docker@2
displayName: Build and push basicmetadata-image to container registry
inputs:
command: buildAndPush
repository: basicmetadata
dockerfile: batch/basic_metadata/Dockerfile
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tagVersion)
$(tagLatest)
- job: build_movedata
displayName: Build movedata
steps:
- task: Docker@2
displayName: Build and push movedata-image to container registry
inputs:
command: buildAndPush
repository: movedata
dockerfile: batch/move_data/Dockerfile
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tagVersion)
$(tagLatest)
- job: build_metadataindex
displayName: Build metadataindex
steps:
- task: Docker@2
displayName: Build and push metadataindex-image to container registry
inputs:
command: buildAndPush
repository: metadataindex
dockerfile: batch/metadata_index/Dockerfile
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tagVersion)
$(tagLatest)
- job: build_ingest
displayName: Build ingest
steps:
- publish: argo
artifact: kubernetes
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
displayName: Deploy
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- task: CmdLine@2
inputs:
script: |
echo "environment is $(environment)"
- task: replacetokens@3
inputs:
rootDirectory: '$(Pipeline.Workspace)'
targetFiles: 'kubernetes/*.yml'
encoding: 'auto'
writeBOM: true
actionOnMissing: 'warn'
keepToken: false
tokenPrefix: '$('
tokenSuffix: ')'
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: 'deploy'
kubernetesServiceConnection: '$(kubernetesServiceConnection)'
namespace: 'argo-mgmt'
manifests: |
$(Pipeline.Workspace)/kubernetes/auth-secret.yml
$(Pipeline.Workspace)/kubernetes/config-map.yml
$(Pipeline.Workspace)/kubernetes/ingest-sensor.yml