Match CI build version to Debian Package Build Version.

The Debian Package should have the same version as the rest of the packages
being created as a part of the full build. These changes enable that.

NOTE: The debian package revision is unused but still included in the package
to allow for hyphens in the package version. (https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version)
This commit is contained in:
Bryan Thornbury 2015-11-03 14:13:25 -08:00
parent b1d3ef4b75
commit b63af7e649
4 changed files with 17 additions and 12 deletions

View file

@ -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

View file

@ -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}"

View file

@ -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

View file

@ -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