diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 525c7a57e3ea..dbf43e7b7dcd 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -48,20 +48,22 @@ jobs: fetchDepth: 0 condition: and(succeeded(), eq(variables.SKIP_CHECKOUT, '')) displayName: 'Checkout code' + - script: | + if [ -n "${{ parameters.COMMIT_ID }}" and -n "${{ parameters.SUBMODULE_NAME }}"]; then + git submodule update --init --recursive + cd src/${{ parameters.SUBMODULE_NAME }} + git checkout ${{ parameters.COMMIT_ID }} + cd ../../ + fi - script: | set -x sudo setfacl -R -b $(Agent.BuildDirectory) displayName: 'setfacl' - script: | BRANCH_NAME=$(Build.SourceBranchName) - if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ]; then - BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" - git checkout -b $BRANCH_NAME - elif [ -n "${{ parameters.COMMIT_ID }}" and -n "${{ parameters.SUBMODULE_NAME }}"]; then - git submodule update --init --recursive - cd src/${{ parameters.SUBMODULE_NAME }} - git checkout ${{ parameters.COMMIT_ID }} + [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" fi + git checkout -b $BRANCH_NAME sudo modprobe overlay sudo apt-get install -y acl sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"