diff --git a/docker/tests/Templates/centos7/Dockerfile b/docker/tests/Templates/centos7/Dockerfile index 4293e00ec6..1de7fdf04e 100644 --- a/docker/tests/Templates/centos7/Dockerfile +++ b/docker/tests/Templates/centos7/Dockerfile @@ -1,9 +1,10 @@ FROM centos:7 -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -16,7 +17,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN yum install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN yum install -y $PACKAGENAME +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/debian.8/Dockerfile b/docker/tests/Templates/debian.8/Dockerfile index 141280b8f5..1c52c3b8a2 100644 --- a/docker/tests/Templates/debian.8/Dockerfile +++ b/docker/tests/Templates/debian.8/Dockerfile @@ -1,9 +1,10 @@ FROM debian:jessie -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -20,8 +21,8 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN locale-gen $LANG && update-locale -RUN curl -L -o powershell_$PSVERSIONSTUB-1.debian.8_amd64.deb $PACKAGELOCATIONSTUB/powershell_$PSVERSIONSTUB-1.debian.8_amd64.deb -RUN dpkg -i powershell_$PSVERSIONSTUB-1.debian.8_amd64.deb || : +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dpkg -i $PACKAGENAME || : RUN apt-get install -y -f -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/debian.9/Dockerfile b/docker/tests/Templates/debian.9/Dockerfile index bba1da3974..a1775442b6 100644 --- a/docker/tests/Templates/debian.9/Dockerfile +++ b/docker/tests/Templates/debian.9/Dockerfile @@ -1,9 +1,10 @@ FROM debian:stretch -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -20,8 +21,8 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN locale-gen $LANG && update-locale -RUN curl -L -o powershell_$PSVERSIONSTUB-1.debian.9_amd64.deb $PACKAGELOCATIONSTUB/powershell_$PSVERSIONSTUB-1.debian.9_amd64.deb -RUN dpkg -i powershell_$PSVERSIONSTUB-1.debian.9_amd64.deb || : +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dpkg -i $PACKAGENAME || : RUN apt-get install -y -f -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/fedora26/Dockerfile b/docker/tests/Templates/fedora26/Dockerfile index 627042cff6..25adfec102 100644 --- a/docker/tests/Templates/fedora26/Dockerfile +++ b/docker/tests/Templates/fedora26/Dockerfile @@ -1,9 +1,10 @@ FROM fedora:26 -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -19,7 +20,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN dnf install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dnf install -y $PACKAGENAME +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/fedora27/Dockerfile b/docker/tests/Templates/fedora27/Dockerfile index 5064eb99b7..78bf3595a4 100644 --- a/docker/tests/Templates/fedora27/Dockerfile +++ b/docker/tests/Templates/fedora27/Dockerfile @@ -1,9 +1,10 @@ FROM fedora:27 -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -19,7 +20,7 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN dnf install -y powershell-$PSVERSIONSTUB-1.rhel.7.x86_64.rpm -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dnf install -y $PACKAGENAME +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/fedora28/Dockerfile b/docker/tests/Templates/fedora28/Dockerfile new file mode 100644 index 0000000000..9c9f958f54 --- /dev/null +++ b/docker/tests/Templates/fedora28/Dockerfile @@ -0,0 +1,26 @@ +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 \ + curl \ + glibc-locale-source \ + git \ + compat-openssl10 \ + && 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 + +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dnf install -y $PACKAGENAME +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/opensuse42.2/Dockerfile b/docker/tests/Templates/opensuse42.2/Dockerfile index 5389e11af4..31c16d5927 100644 --- a/docker/tests/Templates/opensuse42.2/Dockerfile +++ b/docker/tests/Templates/opensuse42.2/Dockerfile @@ -1,9 +1,10 @@ FROM opensuse:42.2 -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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" ARG POWERSHELL_LINKFILE=/usr/bin/pwsh @@ -24,15 +25,15 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG -RUN curl -L -o powershell-$PSVERSIONSTUB-linux-x64.tar.gz $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUB-linux-x64.tar.gz +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME # Create the target folder where powershell will be placed -RUN mkdir -p /opt/microsoft/powershell/$PSVERSIONSTUB +RUN mkdir -p /opt/microsoft/powershell # Expand powershell to the target folder -RUN tar zxf powershell-$PSVERSIONSTUB-linux-x64.tar.gz -C /opt/microsoft/powershell/$PSVERSIONSTUB +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell # Create the symbolic link that points to powershell -RUN ln -s /opt/microsoft/powershell/$PSVERSIONSTUB/pwsh $POWERSHELL_LINKFILE +RUN ln -s /opt/microsoft/powershell/pwsh $POWERSHELL_LINKFILE -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN $TESTDOWNLOADCOMMAND +RUN pwsh -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/opensuse42.3/Dockerfile b/docker/tests/Templates/opensuse42.3/Dockerfile new file mode 100644 index 0000000000..d401e61138 --- /dev/null +++ b/docker/tests/Templates/opensuse42.3/Dockerfile @@ -0,0 +1,39 @@ +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" + +ARG POWERSHELL_LINKFILE=/usr/bin/pwsh + +# Install dependencies +RUN zypper --non-interactive update --skip-interactive \ + && zypper --non-interactive install \ + glibc-locale \ + glibc-i18ndata \ + tar \ + curl \ + libunwind \ + libicu \ + openssl \ + git + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG + +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME + +# Create the target folder where powershell will be placed +RUN mkdir -p /opt/microsoft/powershell +# Expand powershell to the target folder +RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell + +# Create the symbolic link that points to powershell +RUN ln -s /opt/microsoft/powershell/pwsh $POWERSHELL_LINKFILE + +RUN $TESTDOWNLOADCOMMAND +RUN pwsh -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/ubuntu14.04/Dockerfile b/docker/tests/Templates/ubuntu14.04/Dockerfile index bc22e9fefc..64058ee820 100644 --- a/docker/tests/Templates/ubuntu14.04/Dockerfile +++ b/docker/tests/Templates/ubuntu14.04/Dockerfile @@ -1,9 +1,10 @@ FROM ubuntu:trusty -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -20,8 +21,8 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN locale-gen $LANG && update-locale -RUN curl -L -o powershell_$PSVERSIONSTUB-1.ubuntu.14.04_amd64.deb $PACKAGELOCATIONSTUB/powershell_$PSVERSIONSTUB-1.ubuntu.14.04_amd64.deb -RUN dpkg -i powershell_$PSVERSIONSTUB-1.ubuntu.14.04_amd64.deb || : +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dpkg -i $PACKAGENAME || : RUN apt-get install -y -f -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/ubuntu16.04/Dockerfile b/docker/tests/Templates/ubuntu16.04/Dockerfile index 521e071612..f84a8fe1ee 100644 --- a/docker/tests/Templates/ubuntu16.04/Dockerfile +++ b/docker/tests/Templates/ubuntu16.04/Dockerfile @@ -1,9 +1,10 @@ FROM ubuntu:xenial -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git +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 \ @@ -20,8 +21,8 @@ ENV LANG en_US.UTF-8 ENV LC_ALL $LANG RUN locale-gen $LANG && update-locale -RUN curl -L -o powershell_$PSVERSIONSTUB-1.ubuntu.16.04_amd64.deb $PACKAGELOCATIONSTUB/powershell_$PSVERSIONSTUB-1.ubuntu.16.04_amd64.deb -RUN dpkg -i powershell_$PSVERSIONSTUB-1.ubuntu.16.04_amd64.deb || : +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dpkg -i $PACKAGENAME || : RUN apt-get install -y -f -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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/ubuntu17.10/Dockerfile b/docker/tests/Templates/ubuntu17.10/Dockerfile deleted file mode 100644 index 8855386733..0000000000 --- a/docker/tests/Templates/ubuntu17.10/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ubuntu:artful - -ARG PSVERSIONSTUB=6.0.2 -ARG PACKAGELOCATIONSTUB -ARG TESTLISTSTUB=/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module -ARG GITLOCATION=https://github.com/PowerShell/PowerShell.git - -# Install dependencies -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - ca-certificates \ - curl \ - apt-transport-https \ - locales \ - git - -# Setup the locale -ENV LANG en_US.UTF-8 -ENV LC_ALL $LANG -RUN locale-gen $LANG && update-locale - -RUN curl -L -o powershell_$PSVERSIONSTUB-1.ubuntu.17.04_amd64.deb $PACKAGELOCATIONSTUB/powershell_$PSVERSIONSTUB-1.ubuntu.17.04_amd64.deb -RUN dpkg -i powershell_$PSVERSIONSTUB-1.ubuntu.17.04_amd64.deb || : -RUN apt-get install -y -f -RUN git clone --recursive $GITLOCATION -RUN pwsh -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLISTSTUB -PassThru).FailedCount" diff --git a/docker/tests/Templates/ubuntu18.04/Dockerfile b/docker/tests/Templates/ubuntu18.04/Dockerfile new file mode 100644 index 0000000000..da7a0b0a3c --- /dev/null +++ b/docker/tests/Templates/ubuntu18.04/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu: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 \ + curl \ + apt-transport-https \ + locales \ + git + +# Setup the locale +ENV LANG en_US.UTF-8 +ENV LC_ALL $LANG +RUN locale-gen $LANG && update-locale + +RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME +RUN dpkg -i $PACKAGENAME || : +RUN apt-get install -y -f +RUN $TESTDOWNLOADCOMMAND +RUN pwsh$PREVIEWSUFFIX -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 afa1c80d2d..2967616eb2 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -213,6 +213,63 @@ function Get-ContainerPowerShellVersion return (Get-Content -Encoding Ascii $testContext.resolvedLogPath)[0] } +# Function defines a config mapping for testing Preview packages. +# The list of supported OS for each release can be found here: +# https://github.com/PowerShell/PowerShell-Docs/blob/staging/reference/docs-conceptual/PowerShell-Core-Support.md#supported-platforms +function Get-DefaultPreviewConfigForPackageValidation +{ + # format: = + @{ 'centos7'='rhel.7'; + 'debian.8'='debian.8'; + 'debian.9'='debian.9'; + 'fedora26'='rhel.7'; + 'fedora27'='rhel.7'; + 'fedora28'='rhel.7'; + 'opensuse42.2'='linux-x64.tar.gz'; + 'opensuse42.3'='linux-x64.tar.gz'; + 'ubuntu14.04'='ubuntu.14.04'; + 'ubuntu16.04'='ubuntu.16.04'; + 'ubuntu18.04'='ubuntu.18.04' + } +} + +# Function defines a config mapping for testing Stable packages. +# The list of supported OS for each release can be found here: +# https://github.com/PowerShell/PowerShell-Docs/blob/staging/reference/docs-conceptual/PowerShell-Core-Support.md#supported-platforms +function Get-DefaultStableConfigForPackageValidation +{ + # format: = + @{ 'centos7'='rhel.7'; + 'debian.8'='debian.8'; + 'debian.9'='debian.9'; + 'fedora26'='rhel.7'; + 'fedora27'='rhel.7'; + 'opensuse42.2'='linux-x64.tar.gz'; + 'opensuse42.3'='linux-x64.tar.gz'; + 'ubuntu14.04'='ubuntu.14.04'; + 'ubuntu16.04'='ubuntu.16.04' + } +} + +# Returns a list of files in a specified Azure container. +function Get-PackageNamesOnAzureBlob +{ + param( + [string] + $ContainerUrl, + + # $SAS (shared access signature) param should include beginning '?' and trailing '&' + [string] + $SAS + ) + + + $response = Invoke-RestMethod -Method Get -Uri $($ContainerUrl + $SAS + 'restype=container&comp=list') + + $xmlResponce = [xml]$response.Substring($response.IndexOf('