-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathazure-pipelines-27.yml
43 lines (38 loc) · 1.1 KB
/
azure-pipelines-27.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
# https://stackoverflow.com/questions/64650431/condition-or-with-variables-in-azure-devops-pipeline
trigger: none
pr: none
variables:
isMaster: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/master')]
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')]
isHotfix: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')]
checkCondition: $[or(variables.isMaster, variables.isRelease)]
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: A
jobs:
- job: A1
steps:
- script: echo Hello Stage A!
- stage: B
condition: or(variables.isMaster ,variables.isRelease)
jobs:
- job: B1
steps:
- task: CmdLine@2
inputs:
script: |
echo %BUILD_SOURCEBRANCH%
echo %ISMASTER%
echo %ISRELEASE%
echo %ISHOTFIX%
echo %CHECKCONDITION%
condition: or(variables.isMaster ,variables.isRelease)
- task: CmdLine@2
inputs:
script: |
echo %BUILD_SOURCEBRANCH%
echo %ISMASTER%
echo %ISRELEASE%
echo %ISHOTFIX%
echo %CHECKCONDITION%