ci: azure: Fix deployment condition

The source branch is in the Build.SourceBranch variable, which is not
the same as variables.Build.SourceBranch - the former expects a variable
named 'Build.SourceBranch', the latter expects 'Build' to be a dict that
contains the key 'SourceBranch'.

Apparently the former is the correct approach, and the latter just
returns null.
This commit is contained in:
Clemens Lang
2020-12-09 21:25:40 +01:00
parent 29d15ebf7c
commit 63d0a5807e
+2 -2
View File
@@ -54,7 +54,7 @@ jobs:
--exclude '/opt/local/var/macports/sip-workaround/?*' \
-cjf "MacPorts.tar.bz2" \
/opt/local
condition: and(succeeded(), or(eq(variables.Build.SourceBranch, 'refs/heads/travis-ci'), startsWith(variables.Build.SourceBranch, 'refs/tags/v')))
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/travis-ci'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
displayName: "Prepare Deployment"
- bash: |
set -eu
@@ -82,5 +82,5 @@ jobs:
env:
user: "macports-ci-env"
pass: $(BINTRAY_API_TOKEN)
condition: and(succeeded(), or(eq(variables.Build.SourceBranch, 'refs/heads/travis-ci'), startsWith(variables.Build.SourceBranch, 'refs/tags/v')))
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/travis-ci'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
displayName: "Deploy to bintray"