From 0acf6c2f019b3a5f19e156354524770f4eafdc1f Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:24:00 +0800 Subject: [PATCH] Improve the PR build version (#7381) Why I did it Improve the version of the Pull Request build by changing the local branch name. How I did it Change the default branch name merge to [target_branch_name]-[pullrequestid]. How to verify it For official build, the version is not changed. For pull request build, the version as below: --- .azure-pipelines/azure-pipelines-image-template.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index c43836f1e31e..81f181cf3cb9 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -38,7 +38,9 @@ jobs: submodules: recursive displayName: 'Checkout code' - script: | - git checkout -b $(Build.SourceBranchName) + BRANCH_NAME=$(Build.SourceBranchName) + [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" + git checkout -b $BRANCH_NAME sudo modprobe overlay sudo apt-get install -y acl sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"