From 8273ec1a2fa1dfe2305b05bd80bbc559c48d3ce7 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 12:31:58 -0700 Subject: [PATCH 01/12] test ci username --- scripts/ci_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index a54abae73..e663935c8 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +whoami SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [[ "$(uname)" == "Linux" ]]; then From 70baca6a1d54cfb0452e734dc68b7f765dafeb5e Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 14:43:24 -0700 Subject: [PATCH 02/12] fix dockerbuild on ubuntu --- scripts/dockerbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 3342074f3..4b5d11676 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 From 32916db70f892de33e2a94fe1e452034a7b1ab9d Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 14:48:45 -0700 Subject: [PATCH 03/12] pull down dependency to fix the build --- src/Microsoft.DotNet.Cli/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Cli/project.json b/src/Microsoft.DotNet.Cli/project.json index 7e36f3044..fcf289a18 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-15981" } }, "frameworks": { From 8a94b30100ff4e68ff08676630aee0b82338b5b1 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 15:12:49 -0700 Subject: [PATCH 04/12] Only build deb packages on mac, fix windows docker build --- build.sh | 4 +++- scripts/ci_build.sh | 2 +- scripts/dockerbuild.sh | 2 +- scripts/package-debian.sh | 2 +- scripts/package.sh | 11 +++++++---- scripts/package_upload.json | 6 ++++++ scripts/windows_dockerbuild.sh | 2 +- src/Microsoft.DotNet.Cli/project.json | 2 +- src/Microsoft.DotNet.Tools.Compiler.Csc/project.json | 2 +- src/Microsoft.DotNet.Tools.Compiler/project.json | 2 +- src/Microsoft.DotNet.Tools.Publish/project.json | 2 +- src/Microsoft.DotNet.Tools.Resgen/project.json | 2 +- 12 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 scripts/package_upload.json diff --git a/build.sh b/build.sh index 94756db24..f5cd82529 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# +# $1 is passed to package to enable deb or pkg packaging ./scripts/bootstrap.sh -./scripts/package.sh +./scripts/package.sh $1 diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index e663935c8..c1e14890e 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -3,7 +3,7 @@ whoami 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 4b5d11676..39e99aa27 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -26,4 +26,4 @@ docker run \ -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 diff --git a/scripts/package-debian.sh b/scripts/package-debian.sh index b15ef37c6..0f11c8c6c 100644 --- 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..b6f11debc 100644 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -11,7 +11,10 @@ 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 +elif [[ "$1" == "pkg" ]]; then + # Create Mac Pkg + $DIR/package-pkg.sh +fi diff --git a/scripts/package_upload.json b/scripts/package_upload.json new file mode 100644 index 000000000..1effb8f14 --- /dev/null +++ b/scripts/package_upload.json @@ -0,0 +1,6 @@ +{ + "name":"dotnet", + "version":"0.3", + "repositoryId":"561d36b9e548cb6eea0d6fc3", + "sourceUrl":"http://dotnetbuilddrops.blob.core.windows.net/debiantest/dotnet_0.3-1_amd64.deb" +} diff --git a/scripts/windows_dockerbuild.sh b/scripts/windows_dockerbuild.sh index a289d16b0..baef8cdd9 100644 --- a/scripts/windows_dockerbuild.sh +++ b/scripts/windows_dockerbuild.sh @@ -82,7 +82,7 @@ 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 } diff --git a/src/Microsoft.DotNet.Cli/project.json b/src/Microsoft.DotNet.Cli/project.json index fcf289a18..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-rc1-15981" + "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" From 7a5354d4b5ff1fc00584214ca7213bc5c974fa42 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 15:21:54 -0700 Subject: [PATCH 05/12] pin versions --- src/Microsoft.Extensions.ProjectModel/project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 " } }, From d00c3ce7425a39a87f10ef2425f3de598a4d76d7 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 15:39:13 -0700 Subject: [PATCH 06/12] dockerbuild parallelization --- scripts/dockerbuild.sh | 3 +-- scripts/windows_dockerbuild.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 39e99aa27..204636c63 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -22,8 +22,7 @@ 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 $1 diff --git a/scripts/windows_dockerbuild.sh b/scripts/windows_dockerbuild.sh index baef8cdd9..940bce6e8 100644 --- a/scripts/windows_dockerbuild.sh +++ b/scripts/windows_dockerbuild.sh @@ -84,7 +84,7 @@ run_build(){ export DOCKER_HOST_SHARE_DIR="$(_convert_path $VM_CODE_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 From 85d4f888eaa9ecba5f58c9cf263879343ad2f330 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 15:56:12 -0700 Subject: [PATCH 07/12] fix relative paths in build --- build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index f5cd82529..fae8425d6 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,14 @@ # # $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 $1 +$DIR/scripts/bootstrap.sh + +$DIR/scripts/package.sh $1 From f4d72cd201cc1dce3a9456f37266532bc3d92ee0 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 16:17:57 -0700 Subject: [PATCH 08/12] docker use executing username to avoid root file perms, support absolute paths in repoapi_client --- scripts/dockerbuild.sh | 1 + scripts/package_upload.json | 6 ------ scripts/repoapi_client.sh | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 scripts/package_upload.json diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 204636c63..76751db16 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -24,5 +24,6 @@ docker build -t $DOTNET_BUILD_CONTAINER_TAG scripts/docker/ docker rm -f $DOTNET_BUILD_CONTAINER_NAME docker run --rm \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ + -u $(whoami) \ -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ $DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND $1 diff --git a/scripts/package_upload.json b/scripts/package_upload.json deleted file mode 100644 index 1effb8f14..000000000 --- a/scripts/package_upload.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name":"dotnet", - "version":"0.3", - "repositoryId":"561d36b9e548cb6eea0d6fc3", - "sourceUrl":"http://dotnetbuilddrops.blob.core.windows.net/debiantest/dotnet_0.3-1_amd64.deb" -} 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 "" } From 2eb25d5c0c4a39886a0b881d3b439913507dc895 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 16:31:27 -0700 Subject: [PATCH 09/12] try to fix file perm issues in ci build: --- scripts/bootstrap.sh | 2 +- scripts/dockerbuild.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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/dockerbuild.sh b/scripts/dockerbuild.sh index 76751db16..3bf20ef41 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -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 --rm \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ - -u $(whoami) \ -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ $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+r /opt/code + From 848dc5e205423123fac5eec2f78c053aad381bc1 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 17:01:49 -0700 Subject: [PATCH 10/12] clean up --- scripts/ci_build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index c1e14890e..ac7a2626b 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -whoami SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [[ "$(uname)" == "Linux" ]]; then From 7d8637b5bbf2c7e15823dc5ab253ee74f28ebf7b Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 17:15:45 -0700 Subject: [PATCH 11/12] add write to all files after docker run --- scripts/dockerbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dockerbuild.sh b/scripts/dockerbuild.sh index 3bf20ef41..b4525c074 100755 --- a/scripts/dockerbuild.sh +++ b/scripts/dockerbuild.sh @@ -29,5 +29,5 @@ docker run --rm \ docker run --rm \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ -e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \ - $DOTNET_BUILD_CONTAINER_TAG chmod a+r /opt/code + $DOTNET_BUILD_CONTAINER_TAG chmod a+rw /opt/code From 7c246f978fdade5060da9d3151643757f0bf1377 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 22 Oct 2015 17:22:58 -0700 Subject: [PATCH 12/12] remove pkg package placeholder --- scripts/package.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/package.sh b/scripts/package.sh index b6f11debc..2a779125c 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -14,7 +14,4 @@ $DIR/package-dnvm.sh if [[ "$1" == "debian" ]]; then # Create Debian package $DIR/package-debian.sh -elif [[ "$1" == "pkg" ]]; then - # Create Mac Pkg - $DIR/package-pkg.sh fi