-
Notifications
You must be signed in to change notification settings - Fork 46
/
azure-pipelines.yml
111 lines (98 loc) · 3.15 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
trigger:
batch: true
branches:
include:
- dev
paths:
exclude:
- README.md
pr: none
variables:
agentOS: ubuntu-latest
docker_repo: skyere/greencity-front
artifactName: drop
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: $(agentOS)
steps:
- task: NodeTool@0
displayName: Set up Node js
inputs:
versionSpec: '18.x'
- task: Npm@1
displayName: Npm install
inputs:
command: 'install'
workingDir: '.'
- task: Npm@1
displayName: Build
inputs:
command: 'custom'
workingDir: '.'
customCommand: 'run build-stage'
- task: Docker@2
displayName: Build Image
inputs:
containerRegistry: 'Dockerhub_Skyere'
repository: '$(docker_repo)'
command: 'build'
Dockerfile: 'Dockerfile'
tags: |
dev-$(Build.BuildId)
latest
- task: Docker@2
displayName: Push image
inputs:
containerRegistry: 'Dockerhub_Skyere'
repository: '$(docker_repo)'
command: 'push'
tags: |
dev-$(Build.BuildId)
- task: CopyFiles@2
displayName: Copy Files
inputs:
SourceFolder: '$(system.defaultworkingdirectory)/greencity-client-chart'
Contents: '**'
TargetFolder: '$(build.artifactstagingdirectory)/greencity-client-chart'
- task: PublishBuildArtifacts@1
displayName: Publish Artifact
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
artifactName: '$(artifactName)'
- stage: Deploy
jobs:
- deployment: DeployClient
displayName: Deploy Client to AKS
pool:
vmImage: $(agentOS)
environment: 'prod'
strategy:
runOnce:
deploy:
steps:
- download: none
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '$(artifactName)'
downloadPath: '$(System.ArtifactsDirectory)'
- task: HelmInstaller@0
inputs:
helmVersion: '3.9.0'
checkLatestHelmVersion: false
installKubectl: true
- task: HelmDeploy@0
inputs:
connectionType: 'Kubernetes Service Connection'
kubernetesServiceConnection: 'k8s-stage'
namespace: 'default'
command: 'upgrade'
chartType: 'FilePath'
chartPath: '$(System.ArtifactsDirectory)/drop/greencity-client-chart'
releaseName: 'client'
overrideValues: 'deployment.image=skyere/greencity-front:dev-$(Build.BuildId)'
arguments: '--debug'