From 104b9118362fbb98558be607f3797672fd63efb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 19 Oct 2018 20:20:40 +0100 Subject: simplify setting GIT_BRANCH and GIT_COMMIT_SHA (#1067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 👍 --- azure-pipelines.yml | 6 ++---- 1 file 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 ' -- cgit v1.2.1