PowerShell/.vsts-ci/install-ps.yml
Bram Crielaard 7031954669 Make install scripts more consistent over different operating systems (#9071)
I noticed a couple of inconsistencies when reading through the install bash scripts. 

- Make documentation for switches consistent over all files.
- Replace all `sed` implementations of `lowercase` with a more maintainable `tr` implementation.
- Set the `OS` variable in every install script, making it so previously unused checks are actually used.
- Exit with a non-zero exit code when the script reaches an illegal state.


## PR Context

A lot of people, including myself, read the install scripts before executing them. While doing so I noticed they contained inconsistencies. For example, certain flags you can pass to the install script were either undocumented or had an incorrect description. This PR fixes some of these inconsistencies, which should make them easier to maintain and easier to read.

Co-authored-by: Travis Plunk <github@ez13.net>
2019-03-08 13:00:04 -08:00

71 lines
1.8 KiB
YAML

name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
trigger:
# Batch merge builds together while a merge build is running
batch: true
branches:
include:
- master
- release*
paths:
include:
- /tools/install-powershell.sh
- /tools/installpsh-amazonlinux.sh
- /tools/installpsh-debian.sh
- /tools/installpsh-osx.sh
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/install-powershell.ps1
pr:
branches:
include:
- master
- release*
paths:
include:
- /tools/install-powershell.sh
- /tools/installpsh-amazonlinux.sh
- /tools/installpsh-debian.sh
- /tools/installpsh-osx.sh
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/install-powershell.ps1
variables:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
resources:
- repo: self
clean: true
phases:
- template: templates/install-ps-phase.yml
parameters:
scriptName: ./tools/install-powershell.sh
jobName: InstallPowerShellUbuntu
pool: Hosted Ubuntu 1604
# amazonlinux was missing adduser
- template: templates/install-ps-phase.yml
parameters:
scriptName: ./tools/install-powershell.sh
jobName: InstallPowerShellCentOS
pool: Hosted Ubuntu 1604
container: mcr.microsoft.com/powershell:centos-7
# VSTS could not find pwsh in:
# mcr.microsoft.com/powershell:opensuse-42.3
# could not repo locally
- template: templates/install-ps-phase.yml
parameters:
scriptName: ./tools/install-powershell.sh
jobName: InstallPowerShellMacOS
pool: Hosted macOS
- template: templates/install-ps-phase.yml
parameters:
scriptName: pwsh -c ./tools/install-powershell.ps1 -AddToPath
jobName: InstallPowerShellPS1Ubuntu
pool: Hosted Ubuntu 1604