From 43114ccd10c5ad097ba0cd4dd9778ad752f71cb9 Mon Sep 17 00:00:00 2001 From: Stephen Bonikowsky Date: Thu, 29 Aug 2019 18:30:18 -0700 Subject: [PATCH] Fix script to use the correct branch name for updating the test service. --- eng/UpdatePRService.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/eng/UpdatePRService.yml b/eng/UpdatePRService.yml index 78cd3046aad..02b78af13a6 100644 --- a/eng/UpdatePRService.yml +++ b/eng/UpdatePRService.yml @@ -42,10 +42,15 @@ steps: goto done :branch - echo Set the repo branch to be what build.SourceBranchName is: %BUILD_SOURCEBRANCHNAME% - REM The following vso call sets a variable that is accessible further down in the PowerShell script to Sync the PR Service. - echo ##vso[task.setvariable variable=branchNameorPrId]origin/%BUILD_SOURCEBRANCHNAME% - goto done + IF '%BUILD_SOURCEBRANCHNAME%'=='3.0.0' OR '%BUILD_SOURCEBRANCHNAME%'=='2.1.0' ( + REM The following vso call sets a variable that is accessible further down in the PowerShell script to Sync the PR Service. + echo ##vso[task.setvariable variable=branchNameorPrId]origin/release/%BUILD_SOURCEBRANCHNAME% + ) ELSE ( + echo Set the repo branch to be what build.SourceBranchName is: %BUILD_SOURCEBRANCHNAME% + REM The following vso call sets a variable that is accessible further down in the PowerShell script to Sync the PR Service. + echo ##vso[task.setvariable variable=branchNameorPrId]origin/%BUILD_SOURCEBRANCHNAME% + goto done + ) :done exit /b %_EXITCODE% @@ -73,8 +78,13 @@ steps: _OPERATION=branch echo "Operation mode has been set to: $_OPERATION" echo "##vso[task.setvariable variable=operation]$_OPERATION" - echo "Set the repo branch to be what build.SourceBranchName is: $BUILD_SOURCEBRANCHNAME" - echo "##vso[task.setvariable variable=branchNameorPrId]origin/$BUILD_SOURCEBRANCHNAME" + if [[ $BUILD_SOURCEBRANCHNAME = 3.0.0 || $BUILD_SOURCEBRANCHNAME = 2.1.0 ]]; then + echo "Set the repo branch to be what build.SourceBranchName is: $BUILD_SOURCEBRANCHNAME" + echo "##vso[task.setvariable variable=branchNameorPrId]origin/release/$BUILD_SOURCEBRANCHNAME" + else + echo "Set the repo branch to be what build.SourceBranchName is: $BUILD_SOURCEBRANCHNAME" + echo "##vso[task.setvariable variable=branchNameorPrId]origin/$BUILD_SOURCEBRANCHNAME" + fi fi displayName: Set_Operation_PR_or_Branch_Unix