-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines-61.yml
53 lines (45 loc) · 1.51 KB
/
azure-pipelines-61.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
# https://stackoverflow.com/questions/67763204/azure-pipelines-compare-key-vault-secrets-in-condition
parameters:
- name: desired
displayName: Desired
type: string
default: test
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- bash: |
echo '$(my-actual)'
echo '${{ parameters.desired }}'
- bash: |
echo "##vso[task.setvariable variable=skipsubsequent]false"
if [ "${{ parameters.desired }}" == "$(my-actual)" ]; then
echo "##vso[task.setvariable variable=skipsubsequent]true"
fi
- bash: echo "EXECUTION REQUIRED ${DESIRED} vs ${ACTUAL})"
condition: and(succeeded(), eq(variables['skipsubsequent'], 'false'))
displayName: "Detected: Necessary"
env:
ACTAUL: $(my-actual)
DESIRED: ${{ parameters.desired }}
- bash: echo "execution NOT required ${DESIRED} vs ${ACTUAL})"
condition: and(succeeded(), eq(variables['skipsubsequent'], 'true'))
displayName: "Detected: Unnecessary"
env:
ACTAUL: $(my-actual)
DESIRED: ${{ parameters.desired }}
- bash: echo "EXECUTION REQUIRED ${DESIRED} vs ${ACTUAL})"
condition: and(succeeded(), ne('${{ parameters.desired }}', '$(my-actual)'))
displayName: "Detected: Necessary"
enabled: false
env:
ACTAUL: $(my-actual)
DESIRED: ${{ parameters.desired }}
- bash: echo "execution NOT required ${DESIRED} vs ${ACTUAL})"
condition: and(succeeded(), eq('${{ parameters.desired }}', '$(my-actual)'))
displayName: "Detected: Unnecessary"
enabled: false
env:
ACTAUL: $(my-actual)
DESIRED: ${{ parameters.desired }}