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
5 changes: 2 additions & 3 deletions docker/tests/Templates/centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM centos:7

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand All @@ -17,7 +16,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-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
RUN yum install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
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"
1 change: 0 additions & 1 deletion docker/tests/Templates/debian.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM debian:jessie

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
1 change: 0 additions & 1 deletion docker/tests/Templates/debian.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM debian:stretch

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
5 changes: 2 additions & 3 deletions docker/tests/Templates/fedora26/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM fedora:26

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand All @@ -18,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-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
RUN dnf install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
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"
5 changes: 2 additions & 3 deletions docker/tests/Templates/fedora27/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM fedora:27

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand All @@ -17,7 +16,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-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm $PACKAGELOCATIONSTUB/powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
RUN dnf install -y powershell-$PSVERSIONSTUBRPM-1.rhel.7.x86_64.rpm
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"
1 change: 0 additions & 1 deletion docker/tests/Templates/kalilinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM kalilinux/kali-linux-docker:latest

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
1 change: 0 additions & 1 deletion docker/tests/Templates/opensuse42.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM opensuse:42.2

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
1 change: 0 additions & 1 deletion docker/tests/Templates/ubuntu14.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM ubuntu:trusty

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
1 change: 0 additions & 1 deletion docker/tests/Templates/ubuntu16.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM ubuntu:xenial

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
1 change: 0 additions & 1 deletion docker/tests/Templates/ubuntu17.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM ubuntu:artful

ARG PSVERSIONSTUB=6.0.2
ARG PSVERSIONSTUBRPM=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
Expand Down
17 changes: 12 additions & 5 deletions docker/tests/containerTestCommon.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function Test-PSPackage
[Parameter(Mandatory=$true)]
$PSPackageLocation, # e.g. Azure storage
[string]
$PSVersion = "6.0.2",
$PSVersion = "6.0.2", # e.g. "6.1.0~preview.2"
[string]
$TestList = "/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module",
[string]
Expand All @@ -246,8 +246,6 @@ function Test-PSPackage

Copy-Item -Recurse $SourceFolder $RootFolder

$versionRpmStubName = 'PSVERSIONSTUBRPM'
$versionRpmStubValue = $PSVersion -replace '-','_'
$versionStubName = 'PSVERSIONSTUB'
$versionStubValue = $PSVersion
$testlistStubName = 'TESTLISTSTUB'
Expand All @@ -264,8 +262,17 @@ function Test-PSPackage
foreach($dir in Get-ChildItem -Path $RootFolder)
{
$buildArgs = @()
$buildArgs += "--build-arg","$versionRpmStubName=$versionRpmStubValue"
$buildArgs += "--build-arg","$versionStubName=$versionStubValue"

if ($dir.Name -eq "opensuse42.2") # special cases that use dash instead of tilda as preview separator, e.g. 'powershell-6.1.0-preview.2-linux-x64.tar.gz'
{
$versionStubDashValue = $PSVersion -replace '~','-'
$buildArgs += "--build-arg","$versionStubName=$versionStubDashValue"
}
else # majority of configurations - they use tilda as preview separator, e.g. 'powershell-6.1.0~preview.2-1.rhel.7.x86_64.rpm'
{
$buildArgs += "--build-arg","$versionStubName=$versionStubValue"
}

$buildArgs += "--build-arg","$testlistStubName=$testlistStubValue"
$buildArgs += "--build-arg","$packageLocationStubName=$packageLocationStubValue"
$buildArgs += "--build-arg","$GitLocationStubName=$GitLocationStubValue"
Expand Down