mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Consolidate test script with launch script
This commit is contained in:
1 parent
ceed98e33d
commit
03237e91b6
2 files changed
+14
-21
No files matched your search
+14
-2
@@ -24,14 +24,26 @@ for build in $BUILDS; do
|
|||||||
# cd so $distro is only the distro name
|
# cd so $distro is only the distro name
|
||||||
cd $build
|
cd $build
|
||||||
for distro in $DISTROS; do
|
for distro in $DISTROS; do
|
||||||
echo "Building $build/$distro"
|
image="$build/$distro"
|
||||||
|
if [[ "$TEST" -eq 1 ]]; then
|
||||||
|
echo "Testing $image"
|
||||||
|
command="cd PowerShell; Import-Module ./build.psm1; Install-Dotnet -NoSudo; Start-PSPester"
|
||||||
|
# clone repo for stable images because it's not already done
|
||||||
|
if [[ "$build" = stable ]]; then
|
||||||
|
command="git clone --recursive https://github.com/$FORK/PowerShell -b $BRANCH; $command"
|
||||||
|
fi
|
||||||
|
# run Pester tests inside container
|
||||||
|
docker run --rm -it powershell/powershell:$build-$distro powershell -c "$command"
|
||||||
|
else
|
||||||
|
echo "Building $image"
|
||||||
# copy the common script because it lives outside the docker build context
|
# copy the common script because it lives outside the docker build context
|
||||||
if [[ "$build" = "unstable" ]]; then
|
if [[ "$build" = unstable ]]; then
|
||||||
cp bootstrap.ps1 $distro
|
cp bootstrap.ps1 $distro
|
||||||
buildargs="--build-arg fork=$FORK --build-arg branch=$BRANCH"
|
buildargs="--build-arg fork=$FORK --build-arg branch=$BRANCH"
|
||||||
fi
|
fi
|
||||||
# build and tag the image so they can be derived from
|
# build and tag the image so they can be derived from
|
||||||
docker build $buildargs -t powershell/powershell:$build-$distro $distro
|
docker build $buildargs -t powershell/powershell:$build-$distro $distro
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Build specified distributions
|
|
||||||
if [[ -z $DISTROS ]]; then
|
|
||||||
DISTROS="ubuntu14.04 ubuntu16.04 centos7"
|
|
||||||
fi
|
|
||||||
|
|
||||||
build=unstable
|
|
||||||
command="cd PowerShell; Import-Module ./build.psm1; Start-PSPester"
|
|
||||||
|
|
||||||
cd $build
|
|
||||||
for distro in $DISTROS; do
|
|
||||||
echo "Testing $build/$distro"
|
|
||||||
# Run Pester tests inside container
|
|
||||||
docker run -it powershell/powershell:$build-$distro powershell -c "$command"
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
Reference in new issue
Block a user