diff --git a/build.sh b/build.sh index 457b0307f..016e47399 100755 --- a/build.sh +++ b/build.sh @@ -23,4 +23,4 @@ fi echo Building dotnet tools verison - $DOTNET_BUILD_VERSION $DIR/scripts/bootstrap.sh -$DIR/scripts/package.sh $1 +$DIR/scripts/package.sh diff --git a/package_tool/package_tool b/package_tool/package_tool index 7689adfea..aa9a5f08f 100755 --- a/package_tool/package_tool +++ b/package_tool/package_tool @@ -1,23 +1,23 @@ #!/bin/bash # # Takes Parameters: -# $0 = Input Directory -# $1 = Output Directory +# $1 = Input Directory +# $2 = Output Directory +# $3 = Package Version 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_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" -# Output Directories - # Inputs INPUT_SAMPLES_DIR="$INPUT_DIR/samples" INPUT_DOCS_DIR="$INPUT_DIR/docs" @@ -70,7 +70,13 @@ 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") - PACKAGE_VERSION=$($extract_base_cmd $CONFIG "release.package_version") + + # 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 PACKAGE_SOURCE_DIR="${OUTPUT_DIR}/${PACKAGE_NAME}-${PACKAGE_VERSION}" INSTALL_ROOT="/usr/share/${PACKAGE_NAME}" diff --git a/scripts/package-debian.sh b/scripts/package-debian.sh index 97c6e87ad..ee9da11ed 100755 --- a/scripts/package-debian.sh +++ b/scripts/package-debian.sh @@ -14,7 +14,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/_common.sh" if [ "$UNAME" != "Linux" ]; then - errro "Debian Package build only supported on Linux" + error "Debian Package build only supported on Linux" exit 1 fi @@ -59,7 +59,7 @@ create_debian_package(){ mkdir -p $PACKAGE_OUTPUT_DIR - $REPO_ROOT/package_tool/package_tool $PACKAGE_LAYOUT_DIR $PACKAGE_OUTPUT_DIR + $REPO_ROOT/package_tool/package_tool $PACKAGE_LAYOUT_DIR $PACKAGE_OUTPUT_DIR $DOTNET_BUILD_VERSION } test_debian_package(){ @@ -76,4 +76,3 @@ test_debian_package(){ execute DEBIAN_FILE=$(find $PACKAGE_OUTPUT_DIR -iname "*.deb") -$DIR/publish.sh $DEBIAN_FILE diff --git a/scripts/package.sh b/scripts/package.sh index 26bdb2c2f..fcaefd059 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -12,7 +12,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # Create Dnvm Package $DIR/package-dnvm.sh -if [[ "$1" == "debian" ]]; then +if [[ "$(uname)" == "Linux" ]]; then # Create Debian package $DIR/package-debian.sh fi