Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions packaging/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ note that you can override/provide "branding" string with "-b, --brand" flag as
Optional arguments:
-b, --brand string Set branding to be used in package name (it will override any branding string in POM version)
-T, --use-timestamp Use epoch timestamp instead of SNAPSHOT in the package name (if not provided, use "SNAPSHOT")
-o, --output-directory The output directory of packages

Other arguments:
-h, --help Display this help message and exit
Expand Down Expand Up @@ -84,6 +85,16 @@ while [ -n "$1" ]; do
fi
;;

-o | --output-directory)
if [ -n "$OUTPUT_DIR" ]; then
echo "ERROR: you have already entered value for -o, --output-directory"
exit 1
else
OUTPUT_DIR=$2
shift 2
fi
;;

-*|*)
echo "ERROR: no such option $1. -h or --help for help"
exit 1
Expand All @@ -96,7 +107,7 @@ if [ -z "$(which dch)" ] ; then
exit 1
fi

NOW="$(date +%s)"
NOW="$(date +'%Y%m%dT%H%M%S')"
PWD=$(cd $(dirname "$0") && pwd -P)
cd $PWD/../

Expand Down Expand Up @@ -139,15 +150,21 @@ else
fi
fi

/bin/cp debian/changelog /tmp/changelog.orig
/bin/cp debian/changelog debian/changelog.$NOW

dch -b -v "${VERSION}~${DISTCODE}" -u low -m "Apache CloudStack Release ${VERSION}"
sed -i '0,/ UNRELEASED;/s// unstable;/g' debian/changelog

dpkg-checkbuilddeps
dpkg-buildpackage -uc -us -b

/bin/mv /tmp/changelog.orig debian/changelog
/bin/mv debian/changelog.$NOW debian/changelog

if [ -n "$OUTPUT_DIR" ];then
mkdir -p "$OUTPUT_DIR"
mv ../*${VERSION}* "$OUTPUT_DIR"
echo "====== CloudStack packages have been moved to $OUTPUT_DIR ======"
fi

if [ "$USE_TIMESTAMP" == "true" ]; then
(cd $PWD; git reset --hard)
Expand Down