From f8578f2261693deda7bbbc9da6364517b35f2b6b Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 16 Nov 2020 12:15:39 +0000 Subject: [PATCH 1/2] Packaging: new timestamp format and add output dir option --- packaging/build-deb.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index c13fb60853fe..222f497378ee 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -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 @@ -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 @@ -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/../ @@ -139,7 +150,7 @@ 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 @@ -147,7 +158,12 @@ 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" +fi if [ "$USE_TIMESTAMP" == "true" ]; then (cd $PWD; git reset --hard) From 1c5026f85d87e142565aa2b1b3613feb37ca01d8 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 23 Nov 2020 10:37:14 +0000 Subject: [PATCH 2/2] #4471 packaging: echo message after moving packages --- packaging/build-deb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index 222f497378ee..3ec3ee12ff64 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -163,6 +163,7 @@ dpkg-buildpackage -uc -us -b 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