Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly pass --py2 or --py3 to some Azure Pipeline tasks (#27199)
We had incorrectly assumed that all Azure Pipeline VMs had access to Python 2, but that isn't true (the Edge run VMs only have Py3 nowadays). As such, update_hosts.yml and update_manifest.yml broke on those VMs. Instead, make the pyflag a variable for those yml files and set it appropriately.
- Loading branch information
1 parent
36789d9
commit 262bf7f
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
parameters: | ||
pyflag: --py3 | ||
|
||
steps: | ||
- script: ./wpt make-hosts-file | sudo tee -a /etc/hosts | ||
displayName: 'Update hosts (macOS)' | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) | ||
- powershell: | | ||
$hostFile = "$env:systemroot\System32\drivers\etc\hosts" | ||
Copy-Item -Path $hostFile -Destination "$hostFile.back" -Force | ||
python wpt --py2 make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append | ||
python wpt ${{ parameters.pyflag }} make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append | ||
displayName: 'Update hosts (Windows)' | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
parameters: | ||
pyflag: --py3 | ||
|
||
steps: | ||
# `python wpt` instead of `./wpt` is to make this work on Windows: | ||
- script: python wpt --py2 manifest | ||
- script: python wpt ${{ parameters.pyflag }} manifest | ||
displayName: 'Update manifest' |