diff --git a/docker/tests/Templates/fxdependent-centos7/Dockerfile b/docker/tests/Templates/fxdependent-centos7/Dockerfile new file mode 100644 index 0000000000..10cde0cd12 --- /dev/null +++ b/docker/tests/Templates/fxdependent-centos7/Dockerfile @@ -0,0 +1,31 @@ +FROM centos:7 + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN yum install -y \ + glibc-locale-source \ + git + +# Install dotnet-runtime +RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm +RUN yum install -y \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-debian.8/Dockerfile b/docker/tests/Templates/fxdependent-debian.8/Dockerfile new file mode 100644 index 0000000000..ea6ad2dfc0 --- /dev/null +++ b/docker/tests/Templates/fxdependent-debian.8/Dockerfile @@ -0,0 +1,40 @@ +FROM debian:jessie + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + ca-certificates \ + apt-transport-https \ + locales \ + git \ + wget + +# Install dotnet-runtime +RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg +RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ +ADD https://packages.microsoft.com/config/debian/8/prod.list . +RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-debian.9/Dockerfile b/docker/tests/Templates/fxdependent-debian.9/Dockerfile new file mode 100644 index 0000000000..e591a35aba --- /dev/null +++ b/docker/tests/Templates/fxdependent-debian.9/Dockerfile @@ -0,0 +1,30 @@ +FROM microsoft/dotnet:2.1-runtime-stretch-slim + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + ca-certificates \ + apt-transport-https \ + locales \ + git + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-fedora27/Dockerfile b/docker/tests/Templates/fxdependent-fedora27/Dockerfile new file mode 100644 index 0000000000..d96df77b4d --- /dev/null +++ b/docker/tests/Templates/fxdependent-fedora27/Dockerfile @@ -0,0 +1,38 @@ +FROM fedora:27 + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN dnf install -y \ + glibc-locale-source \ + git \ + compat-openssl10 \ + && dnf upgrade-minimal -y --security \ + && dnf clean all + +# Install dotnet-runtime +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc +ADD https://packages.microsoft.com/config/fedora/27/prod.repo . +RUN mv prod.repo /etc/yum.repos.d/microsoft-prod.repo +RUN dnf install -y \ + dotnet-runtime-2.1 \ + && dnf upgrade-minimal -y --security \ + && dnf clean all + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-fedora28/Dockerfile b/docker/tests/Templates/fxdependent-fedora28/Dockerfile new file mode 100644 index 0000000000..a654fa9c0c --- /dev/null +++ b/docker/tests/Templates/fxdependent-fedora28/Dockerfile @@ -0,0 +1,38 @@ +FROM fedora:28 + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN dnf install -y \ + glibc-locale-source \ + git \ + compat-openssl10 \ + && dnf upgrade-minimal -y --security \ + && dnf clean all + +# Install dotnet-runtime +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc +ADD https://packages.microsoft.com/config/fedora/27/prod.repo . +RUN mv prod.repo /etc/yum.repos.d/microsoft-prod.repo +RUN dnf install -y \ + dotnet-runtime-2.1 \ + && dnf upgrade-minimal -y --security \ + && dnf clean all + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-opensuse42.2/Dockerfile b/docker/tests/Templates/fxdependent-opensuse42.2/Dockerfile new file mode 100644 index 0000000000..c38ff0e129 --- /dev/null +++ b/docker/tests/Templates/fxdependent-opensuse42.2/Dockerfile @@ -0,0 +1,40 @@ +FROM opensuse:42.2 + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN zypper --non-interactive update --skip-interactive \ + && zypper --non-interactive install \ + glibc-locale \ + glibc-i18ndata \ + tar \ + libunwind \ + libicu \ + openssl \ + git + +# Install dotnet-runtime +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc +ADD https://packages.microsoft.com/config/opensuse/42.2/prod.repo . +RUN mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo +RUN zypper --non-interactive update --skip-interactive \ + && zypper --non-interactive install \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-opensuse42.3/Dockerfile b/docker/tests/Templates/fxdependent-opensuse42.3/Dockerfile new file mode 100644 index 0000000000..f6122c9d53 --- /dev/null +++ b/docker/tests/Templates/fxdependent-opensuse42.3/Dockerfile @@ -0,0 +1,40 @@ +FROM opensuse:42.3 + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN zypper --non-interactive update --skip-interactive \ + && zypper --non-interactive install \ + glibc-locale \ + glibc-i18ndata \ + tar \ + libunwind \ + libicu \ + openssl \ + git + +# Install dotnet-runtime +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc +ADD https://packages.microsoft.com/config/opensuse/42.2/prod.repo . +RUN mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo +RUN zypper --non-interactive update --skip-interactive \ + && zypper --non-interactive install \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-ubuntu14.04/Dockerfile b/docker/tests/Templates/fxdependent-ubuntu14.04/Dockerfile new file mode 100644 index 0000000000..1f18a09ab3 --- /dev/null +++ b/docker/tests/Templates/fxdependent-ubuntu14.04/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:trusty + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + ca-certificates \ + apt-transport-https \ + locales \ + git + +# Install dotnet-runtime +ADD https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb . +RUN dpkg -i packages-microsoft-prod.deb +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile b/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile new file mode 100644 index 0000000000..ef2538d1aa --- /dev/null +++ b/docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:xenial + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + ca-certificates \ + apt-transport-https \ + locales \ + git + +# Install dotnet-runtime +ADD https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb . +RUN dpkg -i packages-microsoft-prod.deb +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + dotnet-runtime-2.1 + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile b/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile new file mode 100644 index 0000000000..7c73ab2906 --- /dev/null +++ b/docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile @@ -0,0 +1,30 @@ +FROM microsoft/dotnet:2.1-runtime-bionic + +ARG PACKAGENAME +ARG PACKAGELOCATION +ARG PREVIEWSUFFIX= +ARG TESTLIST=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module +ARG TESTDOWNLOADCOMMAND="git clone --recursive https://github.com/PowerShell/PowerShell.git" + +# Install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + ca-certificates \ + apt-transport-https \ + locales \ + git + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +# Install PowerShell package +ADD $PACKAGELOCATION/$PACKAGENAME . +RUN mkdir -p /opt/microsoft/powershell +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Download and run tests +RUN $TESTDOWNLOADCOMMAND +RUN dotnet /opt/microsoft/powershell/pwsh.dll -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 2967616eb2..c4b97a000e 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -229,7 +229,17 @@ function Get-DefaultPreviewConfigForPackageValidation 'opensuse42.3'='linux-x64.tar.gz'; 'ubuntu14.04'='ubuntu.14.04'; 'ubuntu16.04'='ubuntu.16.04'; - 'ubuntu18.04'='ubuntu.18.04' + 'ubuntu18.04'='ubuntu.18.04'; + 'fxdependent-centos7'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-debian.8'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-debian.9'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-fedora27'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-fedora28'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-opensuse42.2'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-opensuse42.3'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-ubuntu14.04'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-ubuntu16.04'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-ubuntu18.04'='linux-x64-fxdependent.tar.gz' } } @@ -247,7 +257,15 @@ function Get-DefaultStableConfigForPackageValidation 'opensuse42.2'='linux-x64.tar.gz'; 'opensuse42.3'='linux-x64.tar.gz'; 'ubuntu14.04'='ubuntu.14.04'; - 'ubuntu16.04'='ubuntu.16.04' + 'ubuntu16.04'='ubuntu.16.04'; + 'fxdependent-centos7'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-debian.8'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-debian.9'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-fedora27'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-opensuse42.2'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-opensuse42.3'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-ubuntu14.04'='linux-x64-fxdependent.tar.gz'; + 'fxdependent-ubuntu16.04'='linux-x64-fxdependent.tar.gz' } } @@ -257,7 +275,7 @@ function Get-PackageNamesOnAzureBlob param( [string] $ContainerUrl, - + # $SAS (shared access signature) param should include beginning '?' and trailing '&' [string] $SAS @@ -315,7 +333,7 @@ function Test-PSPackage { $buildDir = Join-Path $RootFolder $kp.Key $packageName = $packageList | Where-Object {$_ -like $('*'+$kp.Value+'*')} - + if (-not (Test-Path $buildDir)) { Write-Error "Directory does Not exist - $buildDir; Check `$Config parameter and '$RootFolder' folder" @@ -356,7 +374,7 @@ function Test-PSPackage $buildArgs += $dockerDirPath $dockerResult = Invoke-Docker -Command 'build' -Params $buildArgs -FailureAction warning - + $confName = Split-Path -Leaf $dockerDirPath $results.Add($confName, $dockerResult) if (-not $dockerResult) {$returnValue = $false}