diff --git a/build.sh b/build.sh index cbd0639c9..186de4963 100755 --- a/build.sh +++ b/build.sh @@ -16,6 +16,14 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +# Some things depend on HOME and it may not be set. We should fix those things, but until then, we just patch a value in +if [ -z "$HOME" ]; then + export HOME=$DIR/artifacts/home + + [ ! -d "$HOME" ] || rm -Rf $HOME + mkdir -p $HOME +fi + while [[ $# > 0 ]]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" case $lowerI in diff --git a/scripts/dockerrun.sh b/scripts/dockerrun.sh index f56f04d24..2a4902893 100755 --- a/scripts/dockerrun.sh +++ b/scripts/dockerrun.sh @@ -75,6 +75,12 @@ fi [ -z "$DOTNET_BUILD_CONTAINER_NAME" ] && DOTNET_BUILD_CONTAINER_NAME="dotnetcli-build-container" [ -z "$DOCKER_HOST_SHARE_DIR" ] && DOCKER_HOST_SHARE_DIR=$(pwd) +# Make container names CI-specific if we're running in CI +# Jenkins +[ ! -z "$BUILD_TAG" ] && DOTNET_BUILD_CONTAINER_NAME="$BUILD_TAG" +# VSO +[ ! -z "$BUILD_BUILDID" ] && DOTNET_BUILD_CONTAINER_NAME="$BUILD_BUILDID" + # Build the docker container (will be fast if it is already built) echo "Building Docker Container using Dockerfile: $DOCKERFILE" docker build --build-arg USER_ID=$(id -u) -t $DOTNET_BUILD_CONTAINER_TAG $DOCKERFILE