-
Notifications
You must be signed in to change notification settings - Fork 8
/
azure-pipelines.yml
83 lines (73 loc) · 2.65 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
# Instructions: https://aka.ms/yaml
trigger:
- dev
- test
- uat
- stag
- canary
- prod
- master
- main
pool:
vmImage: "ubuntu-latest"
resources:
containers:
- container: taito
image: ${_TEMPLATE_DEFAULT_TAITO_IMAGE}
env:
taito_mode: ci
taito_image: ${_TEMPLATE_DEFAULT_TAITO_IMAGE}
taito_ci_phases: $(TAITO_CI_PHASES)
# TODO: Add branch prefix (e.g. DEV_AZURE_CLIENT_ID)
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
jobs:
- job: build
container: taito
steps:
# init
- bash: |
# Azure creates a new user that we need to initialize
/taito-cli-deps/tools/user-init.sh
# TODO: Cancel other ongoing builds for ENV
# - taito deployment cancel:$(Build.SourceBranchName) TODO_CURRENT_BUILD_ID
displayName: init
# prepare
- bash: |
taito build prepare:$(Build.SourceBranchName) $(Build.SourceVersion)
displayName: prepare
env:
VC_TOKEN: $(VC_TOKEN)
# prepare artifacts
- bash: |
taito artifact prepare:admin:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact prepare:client:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact prepare:server:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact prepare:worker:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact prepare:www:$(Build.SourceBranchName) $(Build.SourceVersion)
displayName: prepare artifacts
# deploy
- bash: |
taito db deploy:$(Build.SourceBranchName)
taito deployment deploy:$(Build.SourceBranchName) $(Build.SourceVersion)
displayName: deploy
# verify
- bash: |
taito deployment wait:$(Build.SourceBranchName)
taito test:$(Build.SourceBranchName)
taito deployment verify:$(Build.SourceBranchName)
displayName: verify
# release artifacts
- bash: |
taito artifact release:admin:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact release:client:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact release:server:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact release:worker:$(Build.SourceBranchName) $(Build.SourceVersion)
taito artifact release:www:$(Build.SourceBranchName) $(Build.SourceVersion)
displayName: release artifacts
# release
- bash: |
taito build release:$(Build.SourceBranchName)
displayName: release
env:
VC_TOKEN: $(VC_TOKEN)