Add RUNARGS and BUILDARGS for more flexibility

E.g. RUNARGS="--rm" or BUILDARGS="--no-cache".
This commit is contained in:
Andrew Schwartzmeyer committed 2016-09-12 15:01:19 -07:00
1 parent e1e014295b
commit 4253051421
1 file changed
+4 -2
+4 -2
View File
@@ -33,7 +33,8 @@ for build in $BUILDS; do
command="git clone --recursive https://github.com/$FORK/PowerShell -b $BRANCH; $command" command="git clone --recursive https://github.com/$FORK/PowerShell -b $BRANCH; $command"
fi fi
# run Pester tests inside container # run Pester tests inside container
docker run --rm -it powershell/powershell:$build-$distro -c "$command" # RUNARGS can be set in the environment
docker run -it $RUNARGS powershell/powershell:$build-$distro -c "$command"
else else
echo "Building $image" 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
@@ -42,7 +43,8 @@ for build in $BUILDS; do
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 # BUILDARGS can be set in the environment
docker build $buildargs $BUILDARGS -t powershell/powershell:$build-$distro $distro
fi fi
done done
cd .. cd ..