diff --git a/build.sh b/build.sh index 94756db24..fae8425d6 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,15 @@ #!/usr/bin/env bash +# +# $1 is passed to package to enable deb or pkg packaging -./scripts/bootstrap.sh +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -./scripts/package.sh +$DIR/scripts/bootstrap.sh + +$DIR/scripts/package.sh $1 diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index bf21bc8b2..815551e23 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -104,4 +104,4 @@ dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REP rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi # Make Stage 2 Folder Accessible -chmod -R a+r $STAGE2_DIR \ No newline at end of file +chmod -R a+r $REPOROOT \ No newline at end of file diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index a54abae73..ac7a2626b 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash - SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [[ "$(uname)" == "Linux" ]]; then - $SCRIPT_DIR/dockerbuild.sh $@ + $SCRIPT_DIR/dockerbuild.sh debian $@ else $SCRIPT_DIR/../build.sh $@ fi diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 3342074f3..b4525c074 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -13,7 +13,7 @@ cd $DIR/.. [ -z "$DOTNET_BUILD_CONTAINER_TAG" ] && DOTNET_BUILD_CONTAINER_TAG="dotnetcli-build" [ -z "$DOTNET_BUILD_CONTAINER_NAME" ] && DOTNET_BUILD_CONTAINER_NAME="dotnetcli-build-container" [ -z "$DOCKER_HOST_SHARE_DIR" ] && DOCKER_HOST_SHARE_DIR=$(pwd) -[ -z "$BUILD_COMMAND" ] && BUILD_COMMAND="//opt\\code\\build.sh" +[ -z "$BUILD_COMMAND" ] && BUILD_COMMAND="/opt/code/build.sh" echo $DOCKER_HOST_SHARE_DIR @@ -21,9 +21,13 @@ echo $DOCKER_HOST_SHARE_DIR docker build -t $DOTNET_BUILD_CONTAINER_TAG scripts/docker/ # Run the build in the container -docker rm -f $DOTNET_BUILD_CONTAINER_NAME -docker run \ +docker run --rm \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ - --name $DOTNET_BUILD_CONTAINER_NAME \ -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ - $DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND + $DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND $1 + +docker run --rm \ + -v $DOCKER_HOST_SHARE_DIR:/opt/code \ + -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ + $DOTNET_BUILD_CONTAINER_TAG chmod a+rw /opt/code + diff --git a/scripts/package-debian.sh b/scripts/package-debian.sh index b15ef37c6..0f11c8c6c 100755 --- a/scripts/package-debian.sh +++ b/scripts/package-debian.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build Script +# Debian Packaging Script # Currently Intended to build on ubuntu14.04 SOURCE="${BASH_SOURCE[0]}" diff --git a/scripts/package.sh b/scripts/package.sh index 5c23b11bb..2a779125c 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -11,7 +11,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # Create Dnvm Package $DIR/package-dnvm.sh -# Create Debian package -$DIR/package-debian.sh - -# TODO: Create Pkg \ No newline at end of file +if [[ "$1" == "debian" ]]; then + # Create Debian package + $DIR/package-debian.sh +fi diff --git a/scripts/repoapi_client.sh b/scripts/repoapi_client.sh index 72c576cf9..135e0bbdc 100644 --- a/scripts/repoapi_client.sh +++ b/scripts/repoapi_client.sh @@ -68,7 +68,7 @@ function AddPackage fi packageUrl=$(grep "sourceUrl" $packageFile | head -n 1 | awk '{print $2}') echo "Adding package to $server [$packageUrl]" - curl -i -k "$baseurl/v1/packages" --data @./$packageFile -H "Content-Type: application/json" + curl -i -k "$baseurl/v1/packages" --data @$packageFile -H "Content-Type: application/json" BailIf $? echo "" } diff --git a/scripts/windows_dockerbuild.sh b/scripts/windows_dockerbuild.sh index a289d16b0..940bce6e8 100644 --- a/scripts/windows_dockerbuild.sh +++ b/scripts/windows_dockerbuild.sh @@ -82,9 +82,9 @@ copy_code_to_vm(){ run_build(){ # These are env variables for dockerbuild.sh export DOCKER_HOST_SHARE_DIR="$(_convert_path $VM_CODE_DIR)" - echo $DOCKER_HOST_SHARE_DIR + export BUILD_COMMAND="//opt\\code\\build.sh" - $DIR/dockerbuild.sh + $DIR/dockerbuild.sh debian } # This will duplicate the entire repo + any side effects from diff --git a/src/Microsoft.DotNet.Cli/project.json b/src/Microsoft.DotNet.Cli/project.json index 7e36f3044..b927627b4 100644 --- a/src/Microsoft.DotNet.Cli/project.json +++ b/src/Microsoft.DotNet.Cli/project.json @@ -20,7 +20,7 @@ }, "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15838" } }, "frameworks": { diff --git a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json index 3b405a92a..37137989e 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json @@ -23,7 +23,7 @@ }, "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15838" }, "Microsoft.Net.Compilers.netcore": "1.1.0-*" }, diff --git a/src/Microsoft.DotNet.Tools.Compiler/project.json b/src/Microsoft.DotNet.Tools.Compiler/project.json index 890337c63..60777510f 100644 --- a/src/Microsoft.DotNet.Tools.Compiler/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler/project.json @@ -23,7 +23,7 @@ }, "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15838" }, "Microsoft.Net.Compilers.netcore": "1.1.0-*" }, diff --git a/src/Microsoft.DotNet.Tools.Publish/project.json b/src/Microsoft.DotNet.Tools.Publish/project.json index 0fc9c1cb4..c0d8ddb35 100644 --- a/src/Microsoft.DotNet.Tools.Publish/project.json +++ b/src/Microsoft.DotNet.Tools.Publish/project.json @@ -21,7 +21,7 @@ }, "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15838" }, "System.AppContext": "4.0.1-beta-23419" }, diff --git a/src/Microsoft.DotNet.Tools.Resgen/project.json b/src/Microsoft.DotNet.Tools.Resgen/project.json index 671fb1215..da64c8872 100644 --- a/src/Microsoft.DotNet.Tools.Resgen/project.json +++ b/src/Microsoft.DotNet.Tools.Resgen/project.json @@ -21,7 +21,7 @@ }, "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15838" }, "System.Xml.XDocument": "4.0.11-beta-23419", "System.Resources.ReaderWriter": "4.0.0-beta-23419" diff --git a/src/Microsoft.Extensions.ProjectModel/project.json b/src/Microsoft.Extensions.ProjectModel/project.json index 36f4f8149..c17c5cd2f 100644 --- a/src/Microsoft.Extensions.ProjectModel/project.json +++ b/src/Microsoft.Extensions.ProjectModel/project.json @@ -17,11 +17,11 @@ "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta-23419", "Microsoft.Extensions.JsonParser.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15792" }, "Microsoft.Extensions.HashCodeCombiner.Sources": { "type": "build", - "version": "1.0.0-*" + "version": "1.0.0-rc1-15718 " } },