-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
36 lines (33 loc) · 1.42 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
trigger:
- develop
- feature/*
- release/*
- hotfix/*
- main
variables:
- name: isDevelop
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/develop') }}
- name: isRelease
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}
- name: isHotfix
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/') }}
- name: isMain
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/main') }}
- name: isCiCdTest
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/ci-cd') }}
- name: canDeployOnDev
value: ${{ or(eq(variables['isDevelop'], 'true'), eq(variables['isHotfix'], 'true'), eq(variables['isCiCdTest'], 'true')) }}
- name: canDeployOnQA
value: ${{ or(eq(variables['isDevelop'], 'true'), eq(variables['isHotfix'], 'true'), eq(variables['isRelease'], 'true')) }}
- name: canDeployOnStaging
value: ${{ or(eq(variables['isHotfix'], 'true'), eq(variables['isRelease'], 'true')) }}
- name: canDeployOnProduction
value: ${{ or(eq(variables['isHotfix'], 'true'), eq(variables['isRelease'], 'true'), eq(variables['isMain'], 'true')) }}
- group: platform-basic
stages:
- template: pipelines/azure/build.template.yml
- ${{ if eq(variables['canDeployOnDev'], 'true') }}:
- template: pipelines/azure/deploy.template.yml
parameters:
displayName: 'Deploy to Dev'
environment: 'dev'