From 797e43654712f839e9a82b06666104d86d566609 Mon Sep 17 00:00:00 2001 From: Bryan Date: Wed, 6 Jan 2016 16:46:25 -0800 Subject: [PATCH 1/3] Package Tool Changes to support versioning changes. 1. Support CONFLICTS in debian packages 2. Associated Build Changes 3. Better cmd line option support in package_tool --- ..._config.json => dotnet-debian_config.json} | 10 +- .../debian/dotnet-nightly-debian_config.json | 54 +++++++++ packaging/debian/package_tool/README.md | 33 +++++- packaging/debian/package_tool/package_tool | 103 ++++++++++++++---- .../scripts/config_template_generator.py | 4 + .../package_tool/scripts/debian_build_lib.sh | 1 - .../package_tool/templates/debian/control | 1 + packaging/debian/package_tool/test.sh | 2 +- scripts/build/generate-version.ps1 | 20 ++-- scripts/build/generate-version.sh | 13 ++- scripts/package/package-debian.sh | 34 ++++-- 11 files changed, 218 insertions(+), 57 deletions(-) rename packaging/debian/{debian_config.json => dotnet-debian_config.json} (93%) create mode 100644 packaging/debian/dotnet-nightly-debian_config.json diff --git a/packaging/debian/debian_config.json b/packaging/debian/dotnet-debian_config.json similarity index 93% rename from packaging/debian/debian_config.json rename to packaging/debian/dotnet-debian_config.json index e27333547..caf938fee 100644 --- a/packaging/debian/debian_config.json +++ b/packaging/debian/dotnet-debian_config.json @@ -2,14 +2,14 @@ "maintainer_name":"Microsoft", "maintainer_email": "dotnetcore@microsoft.com", - "package_name": "dotnet-dev", + "package_name": "dotnet", "short_description": ".NET Core & command line tools", "long_description": ".NET Core is a cross-platform implementation of .NET Framework, a modern, modular platform\n for building diverse kinds of applications, from command-line applications to microservices and \n modern websites.\n This package contains the tools you will need to start writing applications for .NET Core. It includes \n compilers, package managers and other utilities that developers need.", "homepage": "https://dotnet.github.io/core", "release":{ - "package_version":"0.201", + "package_version":"0.0.0.0", "package_revision":"1", "urgency" : "low", "changelog_message" : "Bootstrap loop package" @@ -33,6 +33,10 @@ "libcurl3" : {} }, + "package_conflicts" : [ + "dotnet-nightly" + ], + "symlinks": { "bin/dotnet" : "usr/bin/dotnet", "bin/dotnet-build" : "usr/bin/dotnet-build", @@ -40,7 +44,7 @@ "bin/dotnet-compile-csc" : "usr/bin/dotnet-compile-csc", "bin/dotnet-compile-fsc" : "usr/bin/dotnet-compile-fsc", "bin/dotnet-compile-native" : "/usr/bin/dotnet-compile-native", - "bin/dotnet-init":"usr/bin/dotnet-new", + "bin/dotnet-new": "usr/bin/dotnet-new", "bin/dotnet-publish" : "usr/bin/dotnet-publish", "bin/dotnet-repl" : "usr/bin/dotnet-repl", "bin/dotnet-repl-csi" : "usr/bin/dotnet-repl-csi", diff --git a/packaging/debian/dotnet-nightly-debian_config.json b/packaging/debian/dotnet-nightly-debian_config.json new file mode 100644 index 000000000..f71a74193 --- /dev/null +++ b/packaging/debian/dotnet-nightly-debian_config.json @@ -0,0 +1,54 @@ +{ + "maintainer_name":"Microsoft", + "maintainer_email": "dotnetcore@microsoft.com", + + "package_name": "dotnet-nightly", + + "short_description": "Unstable Developer Build of .NET Core & command line tools", + "long_description": "Unstable Developer Build of .NET Core is a cross-platform implementation of .NET Framework, a modern, modular platform\n for building diverse kinds of applications, from command-line applications to microservices and \n modern websites.\n This package contains the tools you will need to start writing applications for .NET Core. It includes \n compilers, package managers and other utilities that developers need.", + "homepage": "https://dotnet.github.io/core", + + "release":{ + "package_version":"0.0.0.0", + "package_revision":"1", + "urgency" : "low", + "changelog_message" : "Bootstrap loop package" + }, + + "control": { + "priority":"standard", + "section":"devel", + "architecture":"any" + }, + + "copyright": "2015 Microsoft", + "license": { + "type": "MIT", + "full_text": "Copyright (c) 2015 Microsoft\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." + }, + + "debian_dependencies":{ + "libssl-dev" : {}, + "clang-3.5" : {}, + "libcurl3" : {} + }, + + "package_conflicts" : [ + "dotnet" + ], + + "symlinks": { + "bin/dotnet" : "usr/bin/dotnet", + "bin/dotnet-compile" : "usr/bin/dotnet-compile", + "bin/dotnet-compile-csc" : "usr/bin/dotnet-compile-csc", + "bin/dotnet-compile-fsc" : "usr/bin/dotnet-compile-fsc", + "bin/dotnet-compile-native" : "/usr/bin/dotnet-compile-native", + "bin/dotnet-new": "usr/bin/dotnet-new", + "bin/dotnet-publish" : "usr/bin/dotnet-publish", + "bin/dotnet-repl" : "usr/bin/dotnet-repl", + "bin/dotnet-repl-csi" : "usr/bin/dotnet-repl-csi", + "bin/dotnet-restore" : "usr/bin/dotnet-restore", + "bin/dotnet-test" : "usr/bin/dotnet-test", + "bin/dotnet-resgen" : "usr/bin/dotnet-resgen" + } +} diff --git a/packaging/debian/package_tool/README.md b/packaging/debian/package_tool/README.md index c94686bb9..32b7443c0 100644 --- a/packaging/debian/package_tool/README.md +++ b/packaging/debian/package_tool/README.md @@ -1,13 +1,32 @@ -# Debian Packagify +# Debian Package Tool + +This is a tool which simplifies the creation process of a debian package. +Use of this tool requires creating a json configuration, and appropriate +directory structure with your desired files to be included. -A tool which consumes a directory structure to produce a debian package. ## Usage - package_tool [path to input directory] [path to output directory] +``` + Usage: package_tool [-i ] [-o ] + [-n ] [-v ] [-h] + + REQUIRED: + -i : Input directory conforming to package_tool conventions and debian_config.json + -o : Output directory for debian package and other artifacts + + OPTIONAL: + -n : name of created package, will override value in debian_config.json + -v : version of created package, will override value in debian_config.json + -h: Show this message + + NOTES: + See Below for more information on package_tool conventions and debian_config.json format +``` ## Input Directory Spec +``` package/ $/ (Contents in this directory will be placed absolutely according to their relative path) usr/lib/somelib.so (ex. This file gets placed at /usr/lib/somelib.so at install) @@ -17,12 +36,15 @@ A tool which consumes a directory structure to produce a debian package. debian_config.json (See example below) docs.json (For manpage generation) (ex. dotnet-commands-test.sh) +``` +Note: The default install root is `/usr/share/{package_name}` where package_name is replaced with the name of the created package ## full example debian_config.json -Note: remove all comments before using this +Note: Use the commentless version here (https://github.com/dotnet/cli/blob/master/packaging/debian/package_tool/example_config.json) +```json { "maintainer_name":"Microsoft", // [required] "maintainer_email": "optimus@service.microsoft.com", // [required] @@ -61,4 +83,5 @@ Note: remove all comments before using this "symlinks": { // (optional no defaults) "path_relative_to_package_root/test_exe.sh" : "usr/bin/test_exe.sh" } - } \ No newline at end of file + } +``` \ No newline at end of file diff --git a/packaging/debian/package_tool/package_tool b/packaging/debian/package_tool/package_tool index 044530e38..b27a4681e 100755 --- a/packaging/debian/package_tool/package_tool +++ b/packaging/debian/package_tool/package_tool @@ -16,22 +16,12 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ## Load Functions ## source $SCRIPT_DIR/scripts/debian_build_lib.sh -INPUT_DIR="$1" -OUTPUT_DIR="$2" -INPUT_PACKAGE_VERSION="$3" - -# Special Input Directories + Paths -ABSOLUTE_PLACEMENT_DIR="${INPUT_DIR}/\$" -PACKAGE_ROOT_PLACEMENT_DIR="${INPUT_DIR}/package_root" - -# Inputs -INPUT_SAMPLES_DIR="$INPUT_DIR/samples" -INPUT_DOCS_DIR="$INPUT_DIR/docs" -DOCS_JSON_PATH="$INPUT_DIR/docs.json" -CONFIG="$INPUT_DIR/debian_config.json" - ## Debian Package Creation Functions ## execute(){ + if ! parse_args_and_set_env_vars $@; then + exit 1 + fi + # Exit if required validation fails if ! validate_inputs; then exit 1 @@ -49,6 +39,60 @@ execute(){ copy_files_to_output } +parse_args_and_set_env_vars(){ + OPTIND=1 # Reset in case getopts has been used previously in the shell. + + while getopts ":n:v:i:o:h" opt; do + case $opt in + n) + PACKAGE_NAME="$OPTARG" + ;; + v) + PACKAGE_VERSION="$OPTARG" + ;; + i) + INPUT_DIR="$OPTARG" + ;; + o) + OUTPUT_DIR="$OPTARG" + ;; + h) + print_help + return 1 + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + return 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + return 1 + ;; + esac + done + + return 0 +} + +print_help(){ + echo "Usage: package_tool [-i ] [-o ] + [-n ] [-v ] [-h] + + REQUIRED: + -i : Input directory conforming to package_tool conventions and debian_config.json + -o : Output directory for debian package and other artifacts + + OPTIONAL: + -n : name of created package, will override value in debian_config.json + -v : version of created package, will override value in debian_config.json + -h: Show this message + + NOTES: + See Readme for more information on package_tool conventions and debian_config.json format + https://github.com/dotnet/cli/tree/master/packaging/debian/package_tool + " +} + validate_inputs(){ local ret=0 if [[ ! -d $ABSOLUTE_PLACEMENT_DIR ]]; then @@ -69,20 +113,35 @@ validate_inputs(){ ret=1 fi + if [[ -z "$INPUT_DIR" ]]; + echo "ERROR: -i Not Specified" + ret=1 + fi + + if [[ -z "$OUTPUT_DIR" ]]; + echo "ERROR: -o Not Specified." + ret=1 + fi + return $ret } parse_config_and_set_env_vars(){ extract_base_cmd="python $SCRIPT_DIR/scripts/extract_json_value.py" - - PACKAGE_NAME=$($extract_base_cmd $CONFIG "package_name") - # Override JSON Defined Version w/ Cmd Line ARG - if [ -z $INPUT_PACKAGE_VERSION ]; then - PACKAGE_VERSION=$($extract_base_cmd $CONFIG "release.package_version") - else - PACKAGE_VERSION=$INPUT_PACKAGE_VERSION - fi + # Arguments Take Precedence over Config + [ -z "$PACKAGE_VERSION" ] && PACKAGE_VERSION="$($extract_base_cmd $CONFIG "release.package_version")" + [ -z "$PACKAGE_NAME" ] && PACKAGE_NAME="$($extract_base_cmd $CONFIG "package_name")" + + # Special Input Directories + Paths + ABSOLUTE_PLACEMENT_DIR="${INPUT_DIR}/\$" + PACKAGE_ROOT_PLACEMENT_DIR="${INPUT_DIR}/package_root" + + # Inputs + INPUT_SAMPLES_DIR="$INPUT_DIR/samples" + INPUT_DOCS_DIR="$INPUT_DIR/docs" + DOCS_JSON_PATH="$INPUT_DIR/docs.json" + CONFIG="$INPUT_DIR/debian_config.json" PACKAGE_SOURCE_DIR="${OUTPUT_DIR}/${PACKAGE_NAME}-${PACKAGE_VERSION}" INSTALL_ROOT="/usr/share/${PACKAGE_NAME}" diff --git a/packaging/debian/package_tool/scripts/config_template_generator.py b/packaging/debian/package_tool/scripts/config_template_generator.py index 9c62ab1af..12becc6c5 100755 --- a/packaging/debian/package_tool/scripts/config_template_generator.py +++ b/packaging/debian/package_tool/scripts/config_template_generator.py @@ -86,6 +86,9 @@ def generate_control(config_data, template_dir): dependency_data = config_data.get("debian_dependencies", None) dependency_str = get_dependendent_packages_string(dependency_data) + conflict_data = config_data.get("package_conflicts", []) + conflict_str = ', '.join(conflict_data) + # Default to empty dict, so we don't explode on nested optional values control_data = config_data.get("control", dict()) @@ -99,6 +102,7 @@ def generate_control(config_data, template_dir): ARCH=control_data.get("architecture", "all"), DEPENDENT_PACKAGES=dependency_str, + CONFLICT_PACKAGES=conflict_str, PACKAGE_NAME=config_data["package_name"], MAINTAINER_NAME=config_data["maintainer_name"], diff --git a/packaging/debian/package_tool/scripts/debian_build_lib.sh b/packaging/debian/package_tool/scripts/debian_build_lib.sh index c899928cf..0b3f4141d 100755 --- a/packaging/debian/package_tool/scripts/debian_build_lib.sh +++ b/packaging/debian/package_tool/scripts/debian_build_lib.sh @@ -14,7 +14,6 @@ # Summary: Writes the contents of the "install_placement" array to the debian/install # This array is populated by calls to the "add_system_file_placement" function # Usage: write_debian_install_file - write_debian_install_file(){ # Remove any existing install file, we need to overwrite it rm -f ${PACKAGE_SOURCE_DIR}/debian/install diff --git a/packaging/debian/package_tool/templates/debian/control b/packaging/debian/package_tool/templates/debian/control index e84255059..49fb2b994 100644 --- a/packaging/debian/package_tool/templates/debian/control +++ b/packaging/debian/package_tool/templates/debian/control @@ -14,5 +14,6 @@ Homepage: {HOMEPAGE} Package: {PACKAGE_NAME} Architecture: {ARCH} Depends: ${{shlibs:Depends}}, ${{misc:Depends}}{DEPENDENT_PACKAGES} +Conflicts: {CONFLICT_PACKAGES} Description: {SHORT_DESCRIPTION} {LONG_DESCRIPTION} diff --git a/packaging/debian/package_tool/test.sh b/packaging/debian/package_tool/test.sh index 739e1feb3..9a7e2fd69 100755 --- a/packaging/debian/package_tool/test.sh +++ b/packaging/debian/package_tool/test.sh @@ -24,7 +24,7 @@ run_integration_tests(){ mkdir -p $output_dir # Build the actual package - $DIR/package_tool $input_dir $output_dir + $DIR/package_tool -i $input_dir -o $output_dir # Integration Test Entrypoint placed by package_tool bats $output_dir/test_package.bats diff --git a/scripts/build/generate-version.ps1 b/scripts/build/generate-version.ps1 index b36e40640..26725d480 100644 --- a/scripts/build/generate-version.ps1 +++ b/scripts/build/generate-version.ps1 @@ -3,17 +3,15 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -#. "$PSScriptRoot\..\common\_common.ps1" +$ReleaseSuffix = "dev" +$MajorVersion = 1 +$MinorVersion = 0 +$PatchVersion = 0 -# Get the timestamp of the most recent commit -$timestamp = git log -1 --format=%ct -$commitTime = [timespan]::FromSeconds($timestamp) +#TODO @krwq is working on this +$CommitCountVersion = 0 -$majorVersion = 1 -$minorVersion = 0 -$buildnumber = 0 -$revnumber = $commitTime.TotalSeconds +# Zero Padded Suffix for use with Nuget +$VersionSuffix = "$ReleaseSuffix-{0:D6}" -f $CommitCountVersion -$VersionSuffix = "dev-$revnumber" - -$env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber" \ No newline at end of file +$env:DOTNET_BUILD_VERSION = "$MajorVersion.$MinorVersion.$PatchVersion.$CommitCountVersion" \ No newline at end of file diff --git a/scripts/build/generate-version.sh b/scripts/build/generate-version.sh index 6d6f168b3..1a3894d83 100755 --- a/scripts/build/generate-version.sh +++ b/scripts/build/generate-version.sh @@ -4,9 +4,12 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -# UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds. -LAST_COMMIT_TIMESTAMP=$(git log -1 --format=%ct) -export DOTNET_BUILD_VERSION=1.0.0-dev-$LAST_COMMIT_TIMESTAMP -echo "Version: $DOTNET_BUILD_VERSION" +export RELEASE_SUFFIX=dev +export MAJOR_VERSION=1 +export MINOR_VERSION=0 +export PATCH_VERSION=0 -unset LAST_COMMIT_TIMESTAMP +#TODO @krwq is working on this +export COMMIT_COUNT_VERSION=0 + +export DOTNET_BUILD_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$COMMIT_COUNT_VERSION diff --git a/scripts/package/package-debian.sh b/scripts/package/package-debian.sh index 89c81d3e2..0804d7060 100755 --- a/scripts/package/package-debian.sh +++ b/scripts/package/package-debian.sh @@ -18,12 +18,12 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -if [ "$UNAME" != "Linux" ]; then - error "Debian Package build only supported on Linux" +if [ "$OSNAME" != "ubuntu" ]; then + error "Debian Package build only supported on Ubuntu" exit 1 fi -PACKAGING_ROOT=$REPOROOT/packaging/debian +PACKAGING_ROOT="$REPOROOT/packaging/debian" OUTPUT_DIR="$REPOROOT/artifacts" PACKAGE_LAYOUT_DIR="$OUTPUT_DIR/deb_intermediate" @@ -32,12 +32,28 @@ TEST_STAGE_DIR="$PACKAGE_OUTPUT_DIR/test" REPO_BINARIES_DIR="$REPOROOT/artifacts/ubuntu.14.04-x64/stage2" MANPAGE_DIR="$REPOROOT/Documentation/manpages" +NIGHTLY_PACKAGE_NAME="dotnet-nightly" +RELEASE_PACKAGE_NAME="dotnet" + execute_build(){ + determine_package_name create_empty_debian_layout copy_files_to_debian_layout create_debian_package } +determine_package_name(){ + if [[ "$RELEASE_SUFFIX" == "dev" ]]; then + DOTNET_DEB_PACKAGE_NAME=$NIGHTLY_PACKAGE_NAME + elif [[ "beta rc1 rc2 rtm" =~ (^| )"$RELEASE_SUFFIX"($| ) ]]; then + DOTNET_DEB_PACKAGE_NAME=$RELEASE_PACKAGE_NAME + elif [[ "$RELEASE_SUFFIX" == "" ]]; then + DOTNET_DEB_PACKAGE_NAME=$RELEASE_PACKAGE_NAME + else + DOTNET_DEB_PACKAGE_NAME=$NIGHTLY_PACKAGE_NAME + fi +} + execute_test(){ test_debian_package } @@ -45,8 +61,8 @@ execute_test(){ create_empty_debian_layout(){ header "Creating empty debian package layout" - rm -rf $PACKAGE_LAYOUT_DIR - mkdir -p $PACKAGE_LAYOUT_DIR + rm -rf "$PACKAGE_LAYOUT_DIR" + mkdir -p "$PACKAGE_LAYOUT_DIR" mkdir "$PACKAGE_LAYOUT_DIR/\$" mkdir "$PACKAGE_LAYOUT_DIR/package_root" @@ -61,7 +77,7 @@ copy_files_to_debian_layout(){ cp -a "$REPO_BINARIES_DIR/." "$PACKAGE_LAYOUT_DIR/package_root" # Copy config file - cp "$PACKAGING_ROOT/debian_config.json" "$PACKAGE_LAYOUT_DIR" + cp "$PACKAGING_ROOT/$DOTNET_DEB_PACKAGE_NAME-debian_config.json" "$PACKAGE_LAYOUT_DIR/debian_config.json" # Copy Manpages cp -a "$MANPAGE_DIR/." "$PACKAGE_LAYOUT_DIR/docs" @@ -70,9 +86,9 @@ copy_files_to_debian_layout(){ create_debian_package(){ header "Packing .deb" - mkdir -p $PACKAGE_OUTPUT_DIR + mkdir -p "$PACKAGE_OUTPUT_DIR" - $PACKAGING_ROOT/package_tool/package_tool $PACKAGE_LAYOUT_DIR $PACKAGE_OUTPUT_DIR $DOTNET_BUILD_VERSION + "$PACKAGING_ROOT/package_tool/package_tool" -i "$PACKAGE_LAYOUT_DIR" -o "$PACKAGE_OUTPUT_DIR" -v $DOTNET_BUILD_VERSION -n $DOTNET_DEB_PACKAGE_NAME } test_debian_package(){ @@ -85,7 +101,7 @@ test_debian_package(){ # E2E Testing of package surface area # Disabled: https://github.com/dotnet/cli/issues/381 - #run_e2e_test + # run_e2e_test } run_e2e_test(){ From f88c9a88f2abfbae9c5e6c9809ea2559bc3a0e92 Mon Sep 17 00:00:00 2001 From: Krzysztof Wicher Date: Mon, 11 Jan 2016 15:41:37 -0800 Subject: [PATCH 2/3] use commit count as revision number --- scripts/build/generate-version.ps1 | 5 ++--- scripts/build/generate-version.sh | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/build/generate-version.ps1 b/scripts/build/generate-version.ps1 index 26725d480..36f584400 100644 --- a/scripts/build/generate-version.ps1 +++ b/scripts/build/generate-version.ps1 @@ -8,10 +8,9 @@ $MajorVersion = 1 $MinorVersion = 0 $PatchVersion = 0 -#TODO @krwq is working on this -$CommitCountVersion = 0 +$CommitCountVersion = (git rev-list --count HEAD).PadLeft(6, "0") # Zero Padded Suffix for use with Nuget -$VersionSuffix = "$ReleaseSuffix-{0:D6}" -f $CommitCountVersion +$VersionSuffix = "$ReleaseSuffix-$CommitCountVersion" $env:DOTNET_BUILD_VERSION = "$MajorVersion.$MinorVersion.$PatchVersion.$CommitCountVersion" \ No newline at end of file diff --git a/scripts/build/generate-version.sh b/scripts/build/generate-version.sh index 1a3894d83..9a39d68a7 100755 --- a/scripts/build/generate-version.sh +++ b/scripts/build/generate-version.sh @@ -9,7 +9,6 @@ export MAJOR_VERSION=1 export MINOR_VERSION=0 export PATCH_VERSION=0 -#TODO @krwq is working on this -export COMMIT_COUNT_VERSION=0 +export COMMIT_COUNT_VERSION=$(printf "%06d" $(git rev-list --count HEAD)) export DOTNET_BUILD_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$COMMIT_COUNT_VERSION From 7011f9e6041ac3e6223a63cc6adc09760d35989e Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 12 Jan 2016 15:27:02 -0800 Subject: [PATCH 3/3] update everything to DOTNET_CLI_VERSION Some package_tool fixes --- .../debian/dotnet-nightly-debian_config.json | 2 + packaging/debian/package_tool/package_tool | 86 ++++++++----------- packaging/debian/package_tool/test.sh | 2 +- packaging/nuget/package.ps1 | 2 +- packaging/osx/package-osx.sh | 16 ++-- packaging/release_debian_config.json | 0 packaging/windows/generatemsi.ps1 | 4 +- scripts/build/build.ps1 | 2 +- scripts/build/build.sh | 2 +- scripts/build/generate-version.ps1 | 14 +-- scripts/build/generate-version.sh | 2 +- scripts/common/_common.ps1 | 2 +- scripts/common/_common.sh | 2 +- scripts/docker/dockerbuild.sh | 2 +- scripts/package/package-debian.sh | 4 +- scripts/package/package-dnvm.sh | 2 +- scripts/package/package-zip.ps1 | 4 +- scripts/package/package.ps1 | 2 +- scripts/package/package.sh | 4 +- scripts/publish/publish.ps1 | 8 +- scripts/publish/publish.sh | 10 +-- 21 files changed, 82 insertions(+), 90 deletions(-) create mode 100644 packaging/release_debian_config.json diff --git a/packaging/debian/dotnet-nightly-debian_config.json b/packaging/debian/dotnet-nightly-debian_config.json index f71a74193..d7916d994 100644 --- a/packaging/debian/dotnet-nightly-debian_config.json +++ b/packaging/debian/dotnet-nightly-debian_config.json @@ -39,6 +39,7 @@ "symlinks": { "bin/dotnet" : "usr/bin/dotnet", + "bin/dotnet-build" : "usr/bin/dotnet-build", "bin/dotnet-compile" : "usr/bin/dotnet-compile", "bin/dotnet-compile-csc" : "usr/bin/dotnet-compile-csc", "bin/dotnet-compile-fsc" : "usr/bin/dotnet-compile-fsc", @@ -48,6 +49,7 @@ "bin/dotnet-repl" : "usr/bin/dotnet-repl", "bin/dotnet-repl-csi" : "usr/bin/dotnet-repl-csi", "bin/dotnet-restore" : "usr/bin/dotnet-restore", + "bin/dotnet-dnx" : "usr/bin/dotnet-dnx", "bin/dotnet-test" : "usr/bin/dotnet-test", "bin/dotnet-resgen" : "usr/bin/dotnet-resgen" } diff --git a/packaging/debian/package_tool/package_tool b/packaging/debian/package_tool/package_tool index b27a4681e..c48da1755 100755 --- a/packaging/debian/package_tool/package_tool +++ b/packaging/debian/package_tool/package_tool @@ -3,12 +3,6 @@ # Copyright (c) .NET Foundation and contributors. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. # - -# Takes Parameters: -# $1 = Input Directory -# $2 = Output Directory -# $3 = Package Version - set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -18,7 +12,7 @@ source $SCRIPT_DIR/scripts/debian_build_lib.sh ## Debian Package Creation Functions ## execute(){ - if ! parse_args_and_set_env_vars $@; then + if ! parse_args_and_set_env_vars "$@"; then exit 1 fi @@ -45,16 +39,16 @@ parse_args_and_set_env_vars(){ while getopts ":n:v:i:o:h" opt; do case $opt in n) - PACKAGE_NAME="$OPTARG" + export PACKAGE_NAME="$OPTARG" ;; v) - PACKAGE_VERSION="$OPTARG" + export PACKAGE_VERSION="$OPTARG" ;; i) - INPUT_DIR="$OPTARG" + export INPUT_DIR="$OPTARG" ;; o) - OUTPUT_DIR="$OPTARG" + export OUTPUT_DIR="$OPTARG" ;; h) print_help @@ -70,6 +64,11 @@ parse_args_and_set_env_vars(){ ;; esac done + + # Special Input Directories + Paths + ABSOLUTE_PLACEMENT_DIR="${INPUT_DIR}/\$" + PACKAGE_ROOT_PLACEMENT_DIR="${INPUT_DIR}/package_root" + CONFIG="$INPUT_DIR/debian_config.json" return 0 } @@ -95,34 +94,28 @@ print_help(){ validate_inputs(){ local ret=0 - if [[ ! -d $ABSOLUTE_PLACEMENT_DIR ]]; then - echo "ERROR: $ directory does not exist" - echo $ABSOLUTE_PLACEMENT_DIR + if [[ -z "$INPUT_DIR" ]]; then + echo "ERROR: -i Not Specified" ret=1 fi - if [[ ! -d $PACKAGE_ROOT_PLACEMENT_DIR ]]; then + if [[ -z "$OUTPUT_DIR" ]]; then + echo "ERROR: -o Not Specified." + ret=1 + fi + + if [[ ! -d "$PACKAGE_ROOT_PLACEMENT_DIR" ]]; then echo "ERROR: package_root directory does not exist" echo $PACKAGE_ROOT_PLACEMENT_DIR ret=1 fi - if [[ ! -f $CONFIG ]]; then + if [[ ! -f "$CONFIG" ]]; then echo "ERROR: debian_config.json file does not exist" echo $CONFIG ret=1 fi - - if [[ -z "$INPUT_DIR" ]]; - echo "ERROR: -i Not Specified" - ret=1 - fi - - if [[ -z "$OUTPUT_DIR" ]]; - echo "ERROR: -o Not Specified." - ret=1 - fi - + return $ret } @@ -133,15 +126,10 @@ parse_config_and_set_env_vars(){ [ -z "$PACKAGE_VERSION" ] && PACKAGE_VERSION="$($extract_base_cmd $CONFIG "release.package_version")" [ -z "$PACKAGE_NAME" ] && PACKAGE_NAME="$($extract_base_cmd $CONFIG "package_name")" - # Special Input Directories + Paths - ABSOLUTE_PLACEMENT_DIR="${INPUT_DIR}/\$" - PACKAGE_ROOT_PLACEMENT_DIR="${INPUT_DIR}/package_root" - # Inputs INPUT_SAMPLES_DIR="$INPUT_DIR/samples" INPUT_DOCS_DIR="$INPUT_DIR/docs" DOCS_JSON_PATH="$INPUT_DIR/docs.json" - CONFIG="$INPUT_DIR/debian_config.json" PACKAGE_SOURCE_DIR="${OUTPUT_DIR}/${PACKAGE_NAME}-${PACKAGE_VERSION}" INSTALL_ROOT="/usr/share/${PACKAGE_NAME}" @@ -193,21 +181,23 @@ package_package_root_placement(){ } package_absolute_placement(){ - abs_in_package_dir="\$" - - add_dir_to_install ${ABSOLUTE_PLACEMENT_DIR} $abs_in_package_dir - - # Get List of all files in directory tree, relative to ABSOLUTE_PLACEMENT_DIR - abs_files=( $(_get_files_in_dir_tree $ABSOLUTE_PLACEMENT_DIR) ) - - # For each file add a a system placement - for abs_file in ${abs_files[@]} - do - parent_dir=$(dirname $abs_file) - filename=$(basename $abs_file) - - add_system_file_placement "$abs_in_package_dir/$abs_file" "/$parent_dir" - done + if [[ -d "$ABSOLUTE_PLACEMENT_DIR" ]]; then + abs_in_package_dir="\$" + + add_dir_to_install ${ABSOLUTE_PLACEMENT_DIR} $abs_in_package_dir + + # Get List of all files in directory tree, relative to ABSOLUTE_PLACEMENT_DIR + abs_files=( $(_get_files_in_dir_tree $ABSOLUTE_PLACEMENT_DIR) ) + + # For each file add a a system placement + for abs_file in ${abs_files[@]} + do + parent_dir=$(dirname $abs_file) + filename=$(basename $abs_file) + + add_system_file_placement "$abs_in_package_dir/$abs_file" "/$parent_dir" + done + fi } package_samples(){ @@ -268,4 +258,4 @@ generate_sample_manifest(){ fi } -execute +execute "$@" diff --git a/packaging/debian/package_tool/test.sh b/packaging/debian/package_tool/test.sh index 9a7e2fd69..9adde436f 100755 --- a/packaging/debian/package_tool/test.sh +++ b/packaging/debian/package_tool/test.sh @@ -18,7 +18,7 @@ run_unit_tests(){ run_integration_tests(){ input_dir=$DIR/test/test_assets/test_package_layout - output_dir=$DIR/p_out + output_dir=$DIR/bin # Create output dir mkdir -p $output_dir diff --git a/packaging/nuget/package.ps1 b/packaging/nuget/package.ps1 index 513298ebf..73e4b5379 100644 --- a/packaging/nuget/package.ps1 +++ b/packaging/nuget/package.ps1 @@ -10,7 +10,7 @@ param( $toolsDir = $toolsDir.TrimEnd('\') $versionArg = "" if ($versionSuffix -ne "") { - $versionArg = "--version-suffix $VersionSuffix" + $versionArg = "--version-suffix $versionSuffix" } . "$PSScriptRoot\..\..\scripts\common\_common.ps1" diff --git a/packaging/osx/package-osx.sh b/packaging/osx/package-osx.sh index 1785e1591..95d252409 100755 --- a/packaging/osx/package-osx.sh +++ b/packaging/osx/package-osx.sh @@ -14,8 +14,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" REPOROOT="$( cd -P "$DIR/../../" && pwd )" -if [ -z "$DOTNET_BUILD_VERSION" ]; then - echo "Provide a version number (DOTNET_BUILD_VERSION) $DOTNET_BUILD_VERSION" && exit 1 +if [ -z "$DOTNET_CLI_VERSION" ]; then + echo "Provide a version number (DOTNET_CLI_VERSION) $DOTNET_CLI_VERSION" && exit 1 fi if [ "$(uname)" == "Darwin" ]; then @@ -36,21 +36,21 @@ fi PACKAGE_DIR=$REPOROOT/artifacts/packages/pkg [ -d "$PACKAGE_DIR" ] || mkdir -p $PACKAGE_DIR -PACKAGE_NAME=$PACKAGE_DIR/dotnet-cli-x64.${DOTNET_BUILD_VERSION}.pkg +PACKAGE_NAME=$PACKAGE_DIR/dotnet-cli-x64.${DOTNET_CLI_VERSION}.pkg #chmod -R 755 $STAGE2_DIR pkgbuild --root $STAGE2_DIR \ - --version $DOTNET_BUILD_VERSION \ + --version $DOTNET_CLI_VERSION \ --scripts $DIR/scripts \ --identifier com.microsoft.dotnet.cli.pkg.dotnet-osx-x64 \ --install-location /usr/local/share/dotnet \ - $DIR/dotnet-osx-x64.$DOTNET_BUILD_VERSION.pkg + $DIR/dotnet-osx-x64.$DOTNET_CLI_VERSION.pkg -cat $DIR/Distribution-Template | sed "/{VERSION}/s//$DOTNET_BUILD_VERSION/g" > $DIR/Dist +cat $DIR/Distribution-Template | sed "/{VERSION}/s//$DOTNET_CLI_VERSION/g" > $DIR/Dist -productbuild --version $DOTNET_BUILD_VERSION --identifier com.microsoft.dotnet.cli --package-path $DIR --resources $DIR/resources --distribution $DIR/Dist $PACKAGE_NAME +productbuild --version $DOTNET_CLI_VERSION --identifier com.microsoft.dotnet.cli --package-path $DIR --resources $DIR/resources --distribution $DIR/Dist $PACKAGE_NAME #Clean temp files -rm $DIR/dotnet-osx-x64.$DOTNET_BUILD_VERSION.pkg +rm $DIR/dotnet-osx-x64.$DOTNET_CLI_VERSION.pkg rm $DIR/Dist $REPOROOT/scripts/publish/publish.sh $PACKAGE_NAME diff --git a/packaging/release_debian_config.json b/packaging/release_debian_config.json new file mode 100644 index 000000000..e69de29bb diff --git a/packaging/windows/generatemsi.ps1 b/packaging/windows/generatemsi.ps1 index 933c3eb45..e5840fb9e 100644 --- a/packaging/windows/generatemsi.ps1 +++ b/packaging/windows/generatemsi.ps1 @@ -63,7 +63,7 @@ function RunCandle Write-Host Running candle.. $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows" - .\candle.exe -dDotnetSrc="$inputDir" -dMicrosoftEula="$RepoRoot\packaging\osx\resources\en.lproj\eula.rtf" -dBuildVersion="$env:DOTNET_BUILD_VERSION" -arch x64 ` + .\candle.exe -dDotnetSrc="$inputDir" -dMicrosoftEula="$RepoRoot\packaging\osx\resources\en.lproj\eula.rtf" -dBuildVersion="$env:DOTNET_CLI_VERSION" -arch x64 ` -ext WixDependencyExtension.dll ` "$AuthWsxRoot\dotnet.wxs" ` "$AuthWsxRoot\provider.wxs" ` @@ -115,7 +115,7 @@ if(!(Test-Path $PackageDir)) mkdir $PackageDir | Out-Null } -$DotnetMSIOutput = Join-Path $PackageDir "dotnet-win-x64.$env:DOTNET_BUILD_VERSION.msi" +$DotnetMSIOutput = Join-Path $PackageDir "dotnet-win-x64.$env:DOTNET_CLI_VERSION.msi" Write-Host "Creating dotnet MSI at $DotnetMSIOutput" diff --git a/scripts/build/build.ps1 b/scripts/build/build.ps1 index eaee0f2db..e6f5969fd 100644 --- a/scripts/build/build.ps1 +++ b/scripts/build/build.ps1 @@ -15,7 +15,7 @@ $ErrorActionPreference="Stop" . "$RepoRoot\scripts\build\generate-version.ps1" -header "Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration" +header "Building dotnet tools version $($env:DOTNET_CLI_VERSION) - $Configuration" header "Checking Pre-Reqs" _ "$RepoRoot\scripts\test\check-prereqs.ps1" diff --git a/scripts/build/build.sh b/scripts/build/build.sh index 585edc741..6d69f0b60 100755 --- a/scripts/build/build.sh +++ b/scripts/build/build.sh @@ -19,7 +19,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" source "$REPOROOT/scripts/build/generate-version.sh" -header "Building dotnet tools version $DOTNET_BUILD_VERSION - $CONFIGURATION" +header "Building dotnet tools version $DOTNET_CLI_VERSION - $CONFIGURATION" header "Checking Pre-Reqs" $REPOROOT/scripts/test/check-prereqs.sh diff --git a/scripts/build/generate-version.ps1 b/scripts/build/generate-version.ps1 index 36f584400..5d3bad767 100644 --- a/scripts/build/generate-version.ps1 +++ b/scripts/build/generate-version.ps1 @@ -3,14 +3,14 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -$ReleaseSuffix = "dev" -$MajorVersion = 1 -$MinorVersion = 0 -$PatchVersion = 0 +$env:ReleaseSuffix = "dev" +$env:MajorVersion = 1 +$env:MinorVersion = 0 +$env:PatchVersion = 0 -$CommitCountVersion = (git rev-list --count HEAD).PadLeft(6, "0") +$env:CommitCountVersion = (git rev-list --count HEAD).PadLeft(6, "0") # Zero Padded Suffix for use with Nuget -$VersionSuffix = "$ReleaseSuffix-$CommitCountVersion" +$env:VersionSuffix = "$env:ReleaseSuffix-$env:CommitCountVersion" -$env:DOTNET_BUILD_VERSION = "$MajorVersion.$MinorVersion.$PatchVersion.$CommitCountVersion" \ No newline at end of file +$env:DOTNET_CLI_VERSION = "$env:MajorVersion.$env:MinorVersion.$env:PatchVersion.$env:CommitCountVersion" \ No newline at end of file diff --git a/scripts/build/generate-version.sh b/scripts/build/generate-version.sh index 9a39d68a7..c8c6e3ead 100755 --- a/scripts/build/generate-version.sh +++ b/scripts/build/generate-version.sh @@ -11,4 +11,4 @@ export PATCH_VERSION=0 export COMMIT_COUNT_VERSION=$(printf "%06d" $(git rev-list --count HEAD)) -export DOTNET_BUILD_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$COMMIT_COUNT_VERSION +export DOTNET_CLI_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$COMMIT_COUNT_VERSION diff --git a/scripts/common/_common.ps1 b/scripts/common/_common.ps1 index f16861057..31c3722f9 100644 --- a/scripts/common/_common.ps1 +++ b/scripts/common/_common.ps1 @@ -18,6 +18,6 @@ $PackageDir = "$RepoRoot\artifacts\packages\dnvm" # Set reasonable defaults for unset variables setEnvIfDefault "DOTNET_INSTALL_DIR" "$(Convert-Path "$PSScriptRoot\..")\.dotnet_stage0\win7-x64" -setEnvIfDefault "DOTNET_BUILD_VERSION" "0.1.0.0" +setEnvIfDefault "DOTNET_CLI_VERSION" "0.1.0.0" setPathAndHomeIfDefault "$Stage2Dir" setVarIfDefault "Configuration" "Debug" diff --git a/scripts/common/_common.sh b/scripts/common/_common.sh index ec3007283..cb0b856c1 100644 --- a/scripts/common/_common.sh +++ b/scripts/common/_common.sh @@ -25,7 +25,7 @@ export STAGE2_DIR=$OUTPUT_ROOT/stage2 export HOST_DIR=$OUTPUT_ROOT/corehost [ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$RID -[ -z "$DOTNET_BUILD_VERSION" ] && export DOTNET_BUILD_VERSION=0.1.0.0 +[ -z "$DOTNET_CLI_VERSION" ] && export DOTNET_CLI_VERSION=0.1.0.0 [ -z "$DOTNET_HOME" ] && export DOTNET_HOME=$STAGE2_DIR && export PATH=$STAGE2_DIR/bin:$PATH [ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug [ -z "$NOCACHE" ] && export NOCACHE="" diff --git a/scripts/docker/dockerbuild.sh b/scripts/docker/dockerbuild.sh index b753d0610..6ec676a4b 100755 --- a/scripts/docker/dockerbuild.sh +++ b/scripts/docker/dockerbuild.sh @@ -34,7 +34,7 @@ info "Using code from: $DOCKER_HOST_SHARE_DIR" docker run -t --rm --sig-proxy=true \ --name $DOTNET_BUILD_CONTAINER_NAME \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ - -e DOTNET_BUILD_VERSION \ + -e DOTNET_CLI_VERSION \ -e SASTOKEN \ -e STORAGE_ACCOUNT \ -e STORAGE_CONTAINER \ diff --git a/scripts/package/package-debian.sh b/scripts/package/package-debian.sh index 0804d7060..38f4c91e8 100755 --- a/scripts/package/package-debian.sh +++ b/scripts/package/package-debian.sh @@ -87,8 +87,8 @@ create_debian_package(){ header "Packing .deb" mkdir -p "$PACKAGE_OUTPUT_DIR" - - "$PACKAGING_ROOT/package_tool/package_tool" -i "$PACKAGE_LAYOUT_DIR" -o "$PACKAGE_OUTPUT_DIR" -v $DOTNET_BUILD_VERSION -n $DOTNET_DEB_PACKAGE_NAME + + "$PACKAGING_ROOT/package_tool/package_tool" -i "$PACKAGE_LAYOUT_DIR" -o "$PACKAGE_OUTPUT_DIR" -v $DOTNET_CLI_VERSION -n $DOTNET_DEB_PACKAGE_NAME } test_debian_package(){ diff --git a/scripts/package/package-dnvm.sh b/scripts/package/package-dnvm.sh index aa873e725..412161753 100755 --- a/scripts/package/package-dnvm.sh +++ b/scripts/package/package-dnvm.sh @@ -22,7 +22,7 @@ fi PACKAGE_DIR=$REPOROOT/artifacts/packages/dnvm [ -d "$PACKAGE_DIR" ] || mkdir -p $PACKAGE_DIR -PACKAGE_SHORT_NAME=dotnet-${OSNAME}-x64.${DOTNET_BUILD_VERSION} +PACKAGE_SHORT_NAME=dotnet-${OSNAME}-x64.${DOTNET_CLI_VERSION} PACKAGE_NAME=$PACKAGE_DIR/${PACKAGE_SHORT_NAME}.tar.gz cd $STAGE2_DIR diff --git a/scripts/package/package-zip.ps1 b/scripts/package/package-zip.ps1 index 8381915c4..6c4b0d2f2 100644 --- a/scripts/package/package-zip.ps1 +++ b/scripts/package/package-zip.ps1 @@ -9,8 +9,8 @@ if(!(Test-Path $PackageDir)) { mkdir $PackageDir | Out-Null } -if(![string]::IsNullOrEmpty($env:DOTNET_BUILD_VERSION)) { - $PackageVersion = $env:DOTNET_BUILD_VERSION +if(![string]::IsNullOrEmpty($env:DOTNET_CLI_VERSION)) { + $PackageVersion = $env:DOTNET_CLI_VERSION } else { $Timestamp = [DateTime]::Now.ToString("yyyyMMddHHmmss") $PackageVersion = "0.0.1-dev-t$Timestamp" diff --git a/scripts/package/package.ps1 b/scripts/package/package.ps1 index c84588a3a..a95b2bd45 100644 --- a/scripts/package/package.ps1 +++ b/scripts/package/package.ps1 @@ -13,4 +13,4 @@ header "Generating dotnet MSI" _ "$RepoRoot\packaging\windows\generatemsi.ps1" @("$Stage2Dir") header "Generating NuGet packages" -_ "$RepoRoot\packaging\nuget\package.ps1" @("$Stage2Dir\bin", "$VersionSuffix") +_ "$RepoRoot\packaging\nuget\package.ps1" @("$Stage2Dir\bin", "$env:VersionSuffix") diff --git a/scripts/package/package.sh b/scripts/package/package.sh index 969a5831f..bda181895 100755 --- a/scripts/package/package.sh +++ b/scripts/package/package.sh @@ -15,9 +15,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" source "$REPOROOT/scripts/build/generate-version.sh" -if [ -z "$DOTNET_BUILD_VERSION" ]; then +if [ -z "$DOTNET_CLI_VERSION" ]; then TIMESTAMP=$(date "+%Y%m%d%H%M%S") - DOTNET_BUILD_VERSION=0.0.1-dev-t$TIMESTAMP + DOTNET_CLI_VERSION=0.0.1-dev-t$TIMESTAMP fi header "Generating tarball" diff --git a/scripts/publish/publish.ps1 b/scripts/publish/publish.ps1 index 10328d12e..e0ac07b1a 100644 --- a/scripts/publish/publish.ps1 +++ b/scripts/publish/publish.ps1 @@ -9,7 +9,7 @@ param( function CheckRequiredVariables { - if([string]::IsNullOrEmpty($env:DOTNET_BUILD_VERSION)) + if([string]::IsNullOrEmpty($env:DOTNET_CLI_VERSION)) { return $false } @@ -71,7 +71,7 @@ function UploadBinaries($zipFile) { $result = -1 $fileName = [System.IO.Path]::GetFileName($zipFile) - $zipBlob = "$env:CHANNEL/Binaries/$env:DOTNET_BUILD_VERSION/$fileName" + $zipBlob = "$env:CHANNEL/Binaries/$env:DOTNET_CLI_VERSION/$fileName" if(-Not (UploadFile $zipBlob $zipFile)) { @@ -88,7 +88,7 @@ function UploadBinaries($zipFile) # update the index file too - $indexContent = "Binaries/$env:DOTNET_BUILD_VERSION/$fileName" + $indexContent = "Binaries/$env:DOTNET_CLI_VERSION/$fileName" $indexFile = "$env:TEMP\latest.win.index" $indexContent | Out-File -FilePath $indexFile @@ -115,7 +115,7 @@ function UploadBinaries($zipFile) function UploadInstallers($msiFile) { $fileName = [System.IO.Path]::GetFileName($msiFile) - $msiBlob = "$env:CHANNEL/Installers/$env:DOTNET_BUILD_VERSION/$fileName" + $msiBlob = "$env:CHANNEL/Installers/$env:DOTNET_CLI_VERSION/$fileName" if(-Not (UploadFile $msiBlob $msiFile)) { diff --git a/scripts/publish/publish.sh b/scripts/publish/publish.sh index 574c63b47..712904945 100755 --- a/scripts/publish/publish.sh +++ b/scripts/publish/publish.sh @@ -54,8 +54,8 @@ execute(){ validate_env_variables(){ local ret=0 - if [[ -z "$DOTNET_BUILD_VERSION" ]]; then - warning "DOTNET_BUILD_VERSION environment variable not set" + if [[ -z "$DOTNET_CLI_VERSION" ]]; then + warning "DOTNET_CLI_VERSION environment variable not set" ret=1 fi @@ -128,7 +128,7 @@ update_file_in_blob_storage(){ upload_binaries_to_blob_storage(){ local tarfile=$1 local filename=$(basename $tarfile) - local blob="$CHANNEL/Binaries/$DOTNET_BUILD_VERSION/$filename" + local blob="$CHANNEL/Binaries/$DOTNET_CLI_VERSION/$filename" if ! upload_file_to_blob_storage_azure_cli $blob $tarfile; then return 1 @@ -143,7 +143,7 @@ upload_binaries_to_blob_storage(){ fi # update the index file - local indexContent="Binaries/$DOTNET_BUILD_VERSION/$filename" + local indexContent="Binaries/$DOTNET_CLI_VERSION/$filename" local indexfile="latest.$OSNAME.index" local index_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$CHANNEL/dnvm/$indexfile$SASTOKEN" update_file_in_blob_storage $index_URL $indexfile $indexContent @@ -161,7 +161,7 @@ upload_binaries_to_blob_storage(){ upload_installers_to_blob_storage(){ local installfile=$1 local filename=$(basename $installfile) - local blob="$CHANNEL/Installers/$DOTNET_BUILD_VERSION/$filename" + local blob="$CHANNEL/Installers/$DOTNET_CLI_VERSION/$filename" if ! upload_file_to_blob_storage_azure_cli $blob $installfile; then return 1