diff --git a/azure-cron.yml b/azure-cron.yml index 81ffe10074..3b7e2be050 100644 --- a/azure-cron.yml +++ b/azure-cron.yml @@ -32,6 +32,7 @@ jobs: timeoutInMinutes: 120 pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: ci/dev-env-install.sh @@ -55,6 +56,7 @@ jobs: timeoutInMinutes: 60 pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: | @@ -95,6 +97,7 @@ jobs: timeoutInMinutes: 10 pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: | @@ -161,6 +164,7 @@ jobs: timeoutInMinutes: 10 pool: name: "linux-pool" + demands: assignment -equals default steps: - checkout: self - bash: | diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 26b1904e87..eb319a49ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,6 +25,7 @@ jobs: - job: git_sha pool: name: 'linux-pool' + demands: assignment -equals default steps: - bash: | set -euo pipefail @@ -48,6 +49,7 @@ jobs: condition: eq(variables['Build.Reason'], 'PullRequest') pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: | @@ -75,6 +77,7 @@ jobs: condition: eq(variables['Build.Reason'], 'PullRequest') pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: ci/check-changelog.sh $(fork_sha) @@ -90,6 +93,7 @@ jobs: timeoutInMinutes: 360 pool: name: 'linux-pool' + demands: assignment -equals default steps: - template: ci/report-start.yml - checkout: self @@ -156,6 +160,7 @@ jobs: timeoutInMinutes: 360 pool: name: 'windows-pool' + demands: assignment -equals default steps: - template: ci/report-start.yml - checkout: self @@ -185,6 +190,7 @@ jobs: timeoutInMinutes: 60 pool: name: linux-pool + demands: assignment -equals default steps: - template: ci/report-start.yml - checkout: self @@ -215,6 +221,7 @@ jobs: timeoutInMinutes: 60 pool: name: 'windows-pool' + demands: assignment -equals default steps: - template: ci/report-start.yml - checkout: self @@ -237,6 +244,7 @@ jobs: fork_sha: $[ dependencies.git_sha.outputs['out.fork_point'] ] pool: name: "linux-pool" + demands: assignment -equals default steps: - bash: | set -euo pipefail @@ -263,6 +271,7 @@ jobs: - job: check_perf_test pool: name: linux-pool + demands: assignment -equals default condition: eq(variables['Build.Reason'], 'IndividualCI') steps: - bash: | @@ -430,6 +439,7 @@ jobs: - compatibility_windows pool: name: "linux-pool" + demands: assignment -equals default variables: Linux.start: $[ dependencies.Linux.outputs['start.time'] ] Linux.machine: $[ dependencies.Linux.outputs['start.machine'] ] @@ -585,6 +595,7 @@ jobs: - collect_build_data pool: name: 'linux-pool' + demands: assignment -equals default variables: pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ] branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ] diff --git a/ci/cron/daily-compat.yml b/ci/cron/daily-compat.yml index 903213f75c..66d296b2d6 100644 --- a/ci/cron/daily-compat.yml +++ b/ci/cron/daily-compat.yml @@ -56,6 +56,7 @@ jobs: timeoutInMinutes: 240 pool: name: windows-pool + demands: assignment -equals default steps: - checkout: self - template: ../compatibility-windows.yml @@ -84,6 +85,7 @@ jobs: timeoutInMinutes: 120 pool: name: "linux-pool" + demands: assignment -equals default steps: - checkout: self - bash: ci/dev-env-install.sh diff --git a/ci/cron/monthly.yaml b/ci/cron/monthly.yaml index d211fb3293..5ad1d05ff4 100644 --- a/ci/cron/monthly.yaml +++ b/ci/cron/monthly.yaml @@ -23,6 +23,7 @@ jobs: timeoutInMinutes: 20 pool: name: 'linux-pool' + demands: assignment -equals default steps: - checkout: self - bash: | diff --git a/infra/vsts_agent_linux_startup.sh b/infra/vsts_agent_linux_startup.sh index 34f499d62c..6b42f6d75d 100644 --- a/infra/vsts_agent_linux_startup.sh +++ b/infra/vsts_agent_linux_startup.sh @@ -104,6 +104,7 @@ VSTS_TOKEN=${vsts_token} mkdir -p ~/agent cd ~/agent +echo 'assignment=default' > .capabilities echo Determining matching VSTS agent... VSTS_AGENT_RESPONSE=$(curl -sSfL \ diff --git a/infra/vsts_agent_windows.tf b/infra/vsts_agent_windows.tf index c7c44291c3..54f8a7643f 100644 --- a/infra/vsts_agent_windows.tf +++ b/infra/vsts_agent_windows.tf @@ -128,6 +128,9 @@ net start winrm echo "== Installing the VSTS agent" +New-Item -ItemType Directory -Path 'C:\agent' +Set-Content -Path 'C:\agent\.capabilities' -Value 'assignment=default' + $MachineName = Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object CSName | ForEach{ $_.CSName } choco install azure-pipelines-agent --no-progress --yes --params "'/Token:${local.vsts_token} /Pool:${local.vsts_pool} /Url:https://dev.azure.com/${local.vsts_account}/ /LogonAccount:$Account /LogonPassword:$Password /Work:D:\a /AgentName:$MachineName /Replace'" echo OK