2016-09-08 14:31:07 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2016-09-08 16:57:32 -07:00
|
|
|
if [[ -z "$FORK" ]]; then
|
|
|
|
|
FORK=PowerShell
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ -z "$BRANCH" ]]; then
|
|
|
|
|
BRANCH=master
|
|
|
|
|
fi
|
|
|
|
|
|
2016-09-08 14:31:07 -07:00
|
|
|
# Build both sets by default
|
|
|
|
|
if [[ -z "$BUILDS" ]]; then
|
|
|
|
|
BUILDS="stable unstable"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Build specified distributions
|
|
|
|
|
if [[ -z $DISTROS ]]; then
|
2016-09-08 16:26:20 -07:00
|
|
|
DISTROS="ubuntu14.04 ubuntu16.04 centos7"
|
2016-09-08 14:31:07 -07:00
|
|
|
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
|
2016-09-08 16:57:32 -07:00
|
|
|
buildargs="--build-arg fork=$FORK --build-arg branch=$BRANCH"
|
2016-09-08 14:31:07 -07:00
|
|
|
fi
|
|
|
|
|
# build and tag the image so they can be derived from
|
2016-09-08 16:57:32 -07:00
|
|
|
docker build $buildargs -t powershell/powershell:$build-$distro $distro
|
2016-09-08 14:31:07 -07:00
|
|
|
done
|
|
|
|
|
cd ..
|
|
|
|
|
done
|