specify vmr runId

This commit is contained in:
MilenaHristova 2023-03-02 11:09:18 +01:00
parent ec4cc26b76
commit 36b5d97be1

View file

@ -4,27 +4,34 @@ pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals 1es-ubuntu-2004
parameters:
- name: dotnetDotnetRunID
displayName: 'Specific dotnet-dotnet run ID'
type: string
default: ' '
jobs:
- job: Get_Build_Information
displayName: Get installer and VMR build ids
variables:
- template: /eng/common/templates/variables/pipelines.yml
- group: Publish-Build-Assets
steps:
- script: |
last_vmr_build=$(az pipelines runs list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --pipeline-ids '$(DOTNET_DOTNET_CI_PIPELINE_ID)' --status completed --top 1 --query "[].id" --output tsv)
if [[ -z "$last_vmr_build" ]]; then
vmr_build=${{ replace(parameters.dotnetDotnetRunID, ' ', '') }}
if [[ -z "$vmr_build" ]]; then
vmr_build=$(az pipelines runs list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --pipeline-ids '$(DOTNET_DOTNET_CI_PIPELINE_ID)' --status completed --top 1 --query "[].id" --output tsv)
fi
if [[ -z "$vmr_build" ]]; then
fail "Could not find a completed vmr build"
exit 1
fi
last_vmr_build=2108850
echo "Vmr build id: '$vmr_build'"
echo "Vmr build id: '$last_vmr_build'"
installer_sha=$(az pipelines build tag list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --build-id $last_vmr_build --output tsv | sed "s,installer-,,g")
installer_sha=$(az pipelines build tag list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --build-id $vmr_build --output tsv | sed "s,installer-,,g")
installer_build=$(az pipelines runs list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --pipeline-ids '$(INSTALLER_OFFICIAL_CI_PIPELINE_ID)' --query "[?sourceVersion == '$installer_sha'].id" --output tsv)
if [[ -z "$installer_build" ]]; then
fail "Could not find a build of installer for commit '$installer_sha'"
@ -34,7 +41,7 @@ jobs:
echo "Installer build id: '$installer_build'"
echo "##vso[task.setvariable variable=InstallerBuildId;isoutput=true]$installer_build"
echo "##vso[task.setvariable variable=VmrBuildId;isoutput=true]$last_vmr_build"
echo "##vso[task.setvariable variable=VmrBuildId;isoutput=true]$vmr_build"
displayName: Get Build IDs
name: Get_Build_Ids
env: