diff options
author | Bernát Gábor <gaborjbernat@gmail.com> | 2018-10-19 20:20:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 20:20:40 +0100 |
commit | 104b9118362fbb98558be607f3797672fd63efb9 (patch) | |
tree | 67256f184157cb17b5fbba44dbec5cca6d5ff1ad | |
parent | 457b8e6e737baeb90a1093356318996c47623c6d (diff) | |
download | tox-git-104b9118362fbb98558be607f3797672fd63efb9.tar.gz |
simplify setting GIT_BRANCH and GIT_COMMIT_SHA (#1067)
👍
-rw-r--r-- | azure-pipelines.yml | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 77f1e239..20b221ff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,8 @@ variables: CI_BUILD_ID: $(Build.BuildId) CI_BUILD_URL: "https://toxdev.visualstudio.com/tox/_build/results?buildId=$(Build.BuildId)" PYTEST_ADDOPTS: "-vv -ra --showlocals" + GIT_BRANCH: $[ coalesce(variables['System.PullRequest.SourceBranch'], variables['Build.SourceBranchName'], 'not-found') ] + GIT_COMMIT_SHA: $[ coalesce(variables['System.PullRequest.SourceCommitId'], variables['Build.SourceVersion'], 'not-found') ] trigger: batch: true @@ -32,8 +34,6 @@ jobs: steps: - script: echo start - script: | - export GIT_BRANCH=$( [[ -n '$(System.PullRequest.PullRequestId)' ]] && echo $(System.PullRequest.SourceBranch) || echo $(Build.SourceBranchName) ) && \ - export GIT_COMMIT_SHA=$( [[ -n '$(System.PullRequest.PullRequestId)' ]] && echo $(System.PullRequest.SourceCommitId) || echo $(Build.SourceVersion) ) && \ printenv && \ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && \ chmod +x ./cc-test-reporter && \ @@ -141,8 +141,6 @@ jobs: failIfCoverageEmpty: true - script: | - export GIT_BRANCH=$( [[ -n '$(System.PullRequest.PullRequestId)' ]] && echo $(System.PullRequest.SourceBranch) || echo $(Build.SourceBranchName) ) && \ - export GIT_COMMIT_SHA=$( [[ -n '$(System.PullRequest.PullRequestId)' ]] && echo $(System.PullRequest.SourceCommitId) || echo $(Build.SourceVersion) ) && \ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && \ chmod +x ./cc-test-reporter && \ python -c ' |