Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .vsts-ci/install-ps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ trigger:
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/install-powershell.ps1
- /.vsts-ci/install-ps.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a circular reference. Why should this file include itself?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, it's just saying run this if this file changes.

pr:
branches:
include:
Expand All @@ -29,6 +30,7 @@ pr:
- /tools/installpsh-redhat.sh
- /tools/installpsh-suse.sh
- /tools/install-powershell.ps1
- /.vsts-ci/install-ps.yml

variables:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand All @@ -40,28 +42,66 @@ resources:
phases:
- template: templates/install-ps-phase.yml
parameters:
scriptName: ./tools/install-powershell.sh
scriptName: sudo ./tools/install-powershell.sh
jobName: InstallPowerShellUbuntu
pool: Hosted Ubuntu 1604
verification: |
if ([Version]"$($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor).$($PSVersionTable.PSVersion.Patch)" -lt [version]"6.2.0")
{
throw "powershell was not upgraded: $($PSVersionTable.PSVersion)"
}

# amazonlinux was missing adduser
- template: templates/install-ps-phase.yml
parameters:
scriptName: sudo ./tools/install-powershell.sh
jobName: InstallPowerShellAmazonLinux
pool: Hosted Ubuntu 1604
container: pshorg/powershellcommunity-test-deps:amazonlinux-2.0
verification: |
if ([Version]"$($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor).$($PSVersionTable.PSVersion.Patch)" -lt [version]"6.2.0")
{
throw "powershell was not upgraded: $($PSVersionTable.PSVersion)"
}

- template: templates/install-ps-phase.yml
parameters:
scriptName: sudo ./tools/installpsh-amazonlinux.sh
jobName: InstallPSHAmazonLinux
pool: Hosted Ubuntu 1604
container: pshorg/powershellcommunity-test-deps:amazonlinux-2.0
verification: |
if ([Version]"$($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor).$($PSVersionTable.PSVersion.Patch)" -lt [version]"6.2.0")
{
throw "powershell was not upgraded: $($PSVersionTable.PSVersion)"
}
# ignoring this due to https://github.com/PowerShell/PowerShell/issues/9285
continueOnError: true

# TODO: add sudo to script and use image with sudo
- 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

# sudo is not needed on macOS
- template: templates/install-ps-phase.yml
parameters:
scriptName: ./tools/install-powershell.sh
jobName: InstallPowerShellMacOS
pool: Hosted macOS
verification: |
if ([Version]"$($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor).$($PSVersionTable.PSVersion.Patch)" -lt [version]"6.2.0")
{
# The script does not upgrade on mac os https://github.com/PowerShell/PowerShell/issues/9322
Write-Warning "powershell was not upgraded: $($PSVersionTable.PSVersion)"
}

- template: templates/install-ps-phase.yml
parameters:
Expand Down
11 changes: 10 additions & 1 deletion .vsts-ci/templates/install-ps-phase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ parameters:
jobName: 'none'
scriptName: ''
container: ''
verification: ''
continueOnError: false

jobs:

Expand All @@ -13,7 +15,8 @@ jobs:
${{ if ne(parameters.container, '') }}:
container: ${{ parameters.container }}

pool: ${{ parameters.pool }}
pool:
name: ${{ parameters.pool }}

displayName: ${{ parameters.jobName }}

Expand All @@ -31,3 +34,9 @@ jobs:
$(scriptName)
displayName: Run Script - $(scriptName)
condition: succeededOrFailed()
continueOnError: ${{ parameters.continueOnError }}

- ${{ if ne(parameters.verification, '') }}:
- powershell: ${{ parameters.verification }}
displayName: Verification
continueOnError: ${{ parameters.continueOnError }}
Empty file modified tools/installpsh-amazonlinux.sh
100644 → 100755
Empty file.