diff --git a/.vsts-ci/install-ps.yml b/.vsts-ci/install-ps.yml index 2d7d07a63f6..9b8a1e23072 100644 --- a/.vsts-ci/install-ps.yml +++ b/.vsts-ci/install-ps.yml @@ -76,8 +76,7 @@ phases: { throw "powershell was not upgraded: $($PSVersionTable.PSVersion)" } - # ignoring this due to https://github.com/PowerShell/PowerShell/issues/9285 - continueOnError: true + continueOnError: false # TODO: add sudo to script and use image with sudo - template: templates/install-ps-phase.yml @@ -85,7 +84,14 @@ phases: scriptName: ./tools/install-powershell.sh jobName: InstallPowerShellCentOS pool: Hosted Ubuntu 1604 - container: mcr.microsoft.com/powershell:centos-7 + container: mcr.microsoft.com/powershell/test-deps:centos-7 + +- template: templates/install-ps-phase.yml + parameters: + scriptName: ./tools/install-powershell.sh + jobName: InstallPowerShellDebian9 + pool: Hosted Ubuntu 1604 + container: mcr.microsoft.com/powershell/test-deps:debian-9 # VSTS could not find pwsh in: diff --git a/tools/installpsh-amazonlinux.sh b/tools/installpsh-amazonlinux.sh index af624602f99..61bbe3e9c7f 100755 --- a/tools/installpsh-amazonlinux.sh +++ b/tools/installpsh-amazonlinux.sh @@ -66,6 +66,13 @@ else elif [ "${OS}" == "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi elif [ -f /etc/SuSE-release ] ; then DistroBasedOn='suse' elif [ -f /etc/mandrake-release ] ; then diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 9837558ed76..40bdc39740a 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -62,6 +62,13 @@ else elif [ "${OS}" == "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi elif [ -f /etc/SuSE-release ] ; then DistroBasedOn='suse' elif [ -f /etc/mandrake-release ] ; then @@ -104,8 +111,13 @@ fi #Collect any variation details if required for this distro # shellcheck disable=SC1091 -. /etc/lsb-release -DISTRIB_ID=$(lowercase "$DISTRIB_ID") +if [[ -f /etc/lsb-release ]]; then + . /etc/lsb-release + DISTRIB_ID=$(lowercase "$DISTRIB_ID") +elif [[ -f /etc/debian_version ]]; then + DISTRIB_ID="debian" + DISTRIB_RELEASE=$(cat /etc/debian_version) +fi #END Collect any variation details if required for this distro #If there are known incompatible versions of this distro, put the test, message and script exit here: diff --git a/tools/installpsh-osx.sh b/tools/installpsh-osx.sh index d61be1da18b..9c0a37c1fe3 100755 --- a/tools/installpsh-osx.sh +++ b/tools/installpsh-osx.sh @@ -60,6 +60,13 @@ else elif [ "${OS}" == "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi elif [ -f /etc/SuSE-release ] ; then DistroBasedOn='suse' elif [ -f /etc/mandrake-release ] ; then diff --git a/tools/installpsh-redhat.sh b/tools/installpsh-redhat.sh index c6398f0c415..631e120690f 100755 --- a/tools/installpsh-redhat.sh +++ b/tools/installpsh-redhat.sh @@ -64,6 +64,13 @@ else elif [ "${OS}" == "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi elif [ -f /etc/SuSE-release ] ; then DistroBasedOn='suse' elif [ -f /etc/mandrake-release ] ; then diff --git a/tools/installpsh-suse.sh b/tools/installpsh-suse.sh index 2ca08bcba28..4e2c5cd0242 100755 --- a/tools/installpsh-suse.sh +++ b/tools/installpsh-suse.sh @@ -64,6 +64,13 @@ else elif [ "${OS}" == "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi elif [ -f /etc/SuSE-release ] ; then DistroBasedOn='suse' elif [ -f /etc/mandrake-release ] ; then