-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
92 lines (87 loc) · 3.43 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
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
trigger:
- main
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
azureSubscription: 'Azure subscription 1(48c0914b-0b56-47e1-9a27-6b17638b4f2b)'
azureContainerRegistry: dclmchilangareg.azurecr.io
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: DockerCompose@0
inputs:
containerregistrytype: 'Azure Container Registry'
azureSubscription: 'Azure subscription 1(48c0914b-0b56-47e1-9a27-6b17638b4f2b)'
azureContainerRegistry: '{"loginServer":"dclmchilangareg.azurecr.io", "id" : "/subscriptions/48c0914b-0b56-47e1-9a27-6b17638b4f2b/resourceGroups/cazAKSRG/providers/Microsoft.ContainerRegistry/registries/dclmChilangaReg"}'
dockerComposeFile: '**/docker-compose.yml'
dockerComposeFileArgs: |
'DB_SERVER=${env:DB_SERVER}'
'DB_PORT=${env:DB_PORT}'
'DATABASE=${env:DATABASE}'
'PASSWORD=${env:PASSWORD}'
'DB_USER=${env:DB_USER}'
action: 'Build services'
- task: DockerCompose@0
inputs:
containerregistrytype: 'Azure Container Registry'
azureSubscription: 'Azure subscription 1(48c0914b-0b56-47e1-9a27-6b17638b4f2b)'
azureContainerRegistry: '{"loginServer":"dclmchilangareg.azurecr.io", "id" : "/subscriptions/48c0914b-0b56-47e1-9a27-6b17638b4f2b/resourceGroups/cazAKSRG/providers/Microsoft.ContainerRegistry/registries/dclmChilangaReg"}'
dockerComposeFile: '**/docker-compose.yml'
dockerComposeFileArgs: |
'DB_SERVER=${env:DB_SERVER}'
'DB_PORT=${env:DB_PORT}'
'DATABASE=${env:DATABASE}'
'PASSWORD=${env:PASSWORD}'
'DB_USER=${env:DB_USER}'
action: 'Push services'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)/s/pac/k8s/net'
artifact: 'manifests'
publishLocation: 'pipeline'
- stage: Deploy
displayName: Deploy to dev
dependsOn: Build
variables:
acrsecret: k8sdclmacrauth
jobs:
- job: Deploy
displayName: Deploy to AKS
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'manifests'
targetPath: '$(Pipeline.Workspace)/manifests'
- task: KubernetesManifest@0
inputs:
action: 'createSecret'
kubernetesServiceConnection: 'k8s-dclm-chilanga-cluster'
namespace: 'default'
secretType: 'dockerRegistry'
secretName: '$(acrsecret)'
dockerRegistryEndpoint: 'K8SDCLMChilangaACR'
- task: KubernetesManifest@0
inputs:
action: 'deploy'
kubernetesServiceConnection: 'k8s-dclm-chilanga-cluster'
namespace: 'default'
manifests: |
$(Pipeline.Workspace)/manifests/database-deployment.yaml
$(Pipeline.Workspace)/manifests/dockerdclm-api-deployment.yaml
$(Pipeline.Workspace)/manifests/pgadmin-deployment.yaml
$(Pipeline.Workspace)/manifests/database-service.yaml
$(Pipeline.Workspace)/manifests/dockerdclm-api-service.yaml
$(Pipeline.Workspace)/manifests/pgadmin-service.yaml
$(Pipeline.Workspace)/manifests/db-volume-persistentvolumeclaim.yaml
$(Pipeline.Workspace)/manifests/dclm-network-networkpolicy.yaml
$(Pipeline.Workspace)/manifests/pgadmin-persistentvolumeclaim.yaml