mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
Executable
+28
@@ -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
|
||||
@@ -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 ..
|
||||
@@ -0,0 +1 @@
|
||||
*/bootstrap.ps1
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user