From b6fe3f2c22a1217f41b3d0abf7172e8757d1719d Mon Sep 17 00:00:00 2001 From: Bram Crielaard Date: Thu, 20 Jun 2019 19:33:32 +0200 Subject: [PATCH 1/7] Fix build on amazon linux --- tools/installpsh-amazonlinux.sh | 7 +++++++ 1 file changed, 7 insertions(+) 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 From a2f1a7fa5ebf1028ea12ba4429a4a82852b38c78 Mon Sep 17 00:00:00 2001 From: Bram Crielaard Date: Thu, 20 Jun 2019 19:37:03 +0200 Subject: [PATCH 2/7] Add back check for amazonlinux --- tools/installpsh-debian.sh | 7 +++++++ tools/installpsh-osx.sh | 7 +++++++ tools/installpsh-redhat.sh | 7 +++++++ tools/installpsh-suse.sh | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 9837558ed76..16f6d4a4bb3 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 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 From 08bb5d26942e141c355b939afca3f7cbe4f6f3e0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 20 Jun 2019 10:56:54 -0700 Subject: [PATCH 3/7] update tests --- .vsts-ci/install-ps.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.vsts-ci/install-ps.yml b/.vsts-ci/install-ps.yml index 2d7d07a63f6..b117c28d735 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,7 @@ 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 # VSTS could not find pwsh in: From 0cb39158292c17582fba28243538c8bece2080c7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 20 Jun 2019 11:02:01 -0700 Subject: [PATCH 4/7] Add debian-9 test --- .vsts-ci/install-ps.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vsts-ci/install-ps.yml b/.vsts-ci/install-ps.yml index b117c28d735..9b8a1e23072 100644 --- a/.vsts-ci/install-ps.yml +++ b/.vsts-ci/install-ps.yml @@ -85,6 +85,13 @@ phases: jobName: InstallPowerShellCentOS pool: Hosted Ubuntu 1604 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: From 198089dbc982e49af931f6ad0271250d9152161c Mon Sep 17 00:00:00 2001 From: Bram Crielaard Date: Thu, 20 Jun 2019 20:24:47 +0200 Subject: [PATCH 5/7] Fix check for debian --- tools/installpsh-debian.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 16f6d4a4bb3..52f46381c9a 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -111,7 +111,12 @@ fi #Collect any variation details if required for this distro # shellcheck disable=SC1091 -. /etc/lsb-release +if [[ -f /etc/lsb_release ]]; then + . /etc/lsb-release +elif [[ -f /etc/debian_version ]]; then + DISTRIB_ID="debian" + DISTRIB_RELEASE=$(cat /etc/debian_version) +fi DISTRIB_ID=$(lowercase "$DISTRIB_ID") #END Collect any variation details if required for this distro From 08729b9b04a008043fbd83b414139f16288f6fdb Mon Sep 17 00:00:00 2001 From: Bram Crielaard Date: Thu, 20 Jun 2019 20:25:37 +0200 Subject: [PATCH 6/7] Clean up unneeded call --- tools/installpsh-debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 52f46381c9a..089b685a938 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -113,11 +113,11 @@ fi # shellcheck disable=SC1091 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 -DISTRIB_ID=$(lowercase "$DISTRIB_ID") #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: From 826e34df414604ea8dc0bad68caf1719f5210a9a Mon Sep 17 00:00:00 2001 From: Bram Crielaard Date: Thu, 20 Jun 2019 20:30:43 +0200 Subject: [PATCH 7/7] Fix typo in filename --- tools/installpsh-debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 089b685a938..40bdc39740a 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -111,7 +111,7 @@ fi #Collect any variation details if required for this distro # shellcheck disable=SC1091 -if [[ -f /etc/lsb_release ]]; then +if [[ -f /etc/lsb-release ]]; then . /etc/lsb-release DISTRIB_ID=$(lowercase "$DISTRIB_ID") elif [[ -f /etc/debian_version ]]; then