Add Docker scripts
Common bootstrap.ps1 script to run PowerShell builds. Launch script to build and tag all containers. Test script to run tests in unstable containers.
This commit is contained in:
parent
6bddaf6534
commit
7375ab58b1
28
docker/launch.sh
Executable file
28
docker/launch.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Build both sets by default
|
||||
if [[ -z "$BUILDS" ]]; then
|
||||
BUILDS="stable unstable"
|
||||
fi
|
||||
|
||||
# Build specified distributions
|
||||
if [[ -z $DISTROS ]]; then
|
||||
DISTROS="ubuntu14.04"
|
||||
fi
|
||||
|
||||
for build in $BUILDS; do
|
||||
# cd so $distro is only the distro name
|
||||
cd $build
|
||||
for distro in $DISTROS; do
|
||||
echo "Building $build/$distro"
|
||||
# copy the common script because it lives outside the docker build context
|
||||
if [[ "$build" = "unstable" ]]; then
|
||||
cp bootstrap.ps1 $distro
|
||||
fi
|
||||
# build and tag the image so they can be derived from
|
||||
docker build -t powershell/powershell:$build-$distro $distro
|
||||
done
|
||||
cd ..
|
||||
done
|
19
docker/test.sh
Normal file
19
docker/test.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/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 ..
|
1
docker/unstable/.gitignore
vendored
Normal file
1
docker/unstable/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*/bootstrap.ps1
|
8
docker/unstable/bootstrap.ps1
Normal file
8
docker/unstable/bootstrap.ps1
Normal file
|
@ -0,0 +1,8 @@
|
|||
# This is intended to be used inside Docker containers
|
||||
|
||||
git clone --recursive https://github.com/PowerShell/PowerShell.git
|
||||
Set-Location PowerShell
|
||||
Import-Module ./build.psm1
|
||||
Start-PSBootstrap -Package -NoSudo
|
||||
Start-PSBuild -Crossgen
|
||||
Start-PSPackage
|
Loading…
Reference in a new issue