@@ -43,6 +43,7 @@ note that you can override/provide "branding" string with "-b, --brand" flag as
4343Optional arguments:
4444 -b, --brand string Set branding to be used in package name (it will override any branding string in POM version)
4545 -T, --use-timestamp Use epoch timestamp instead of SNAPSHOT in the package name (if not provided, use "SNAPSHOT")
46+ -o, --output-directory The output directory of packages
4647
4748Other arguments:
4849 -h, --help Display this help message and exit
@@ -84,6 +85,16 @@ while [ -n "$1" ]; do
8485 fi
8586 ;;
8687
88+ -o | --output-directory)
89+ if [ -n " $OUTPUT_DIR " ]; then
90+ echo " ERROR: you have already entered value for -o, --output-directory"
91+ exit 1
92+ else
93+ OUTPUT_DIR=$2
94+ shift 2
95+ fi
96+ ;;
97+
8798 -* |* )
8899 echo " ERROR: no such option $1 . -h or --help for help"
89100 exit 1
@@ -96,7 +107,7 @@ if [ -z "$(which dch)" ] ; then
96107 exit 1
97108fi
98109
99- NOW=" $( date +%s ) "
110+ NOW=" $( date +' %Y%m%dT%H%M%S ' ) "
100111PWD=$( cd $( dirname " $0 " ) && pwd -P)
101112cd $PWD /../
102113
@@ -139,15 +150,21 @@ else
139150 fi
140151fi
141152
142- /bin/cp debian/changelog /tmp/ changelog.orig
153+ /bin/cp debian/changelog debian/ changelog.$NOW
143154
144155dch -b -v " ${VERSION} ~${DISTCODE} " -u low -m " Apache CloudStack Release ${VERSION} "
145156sed -i ' 0,/ UNRELEASED;/s// unstable;/g' debian/changelog
146157
147158dpkg-checkbuilddeps
148159dpkg-buildpackage -uc -us -b
149160
150- /bin/mv /tmp/changelog.orig debian/changelog
161+ /bin/mv debian/changelog.$NOW debian/changelog
162+
163+ if [ -n " $OUTPUT_DIR " ]; then
164+ mkdir -p " $OUTPUT_DIR "
165+ mv ../* ${VERSION} * " $OUTPUT_DIR "
166+ echo " ====== CloudStack packages have been moved to $OUTPUT_DIR ======"
167+ fi
151168
152169if [ " $USE_TIMESTAMP " == " true" ]; then
153170 (cd $PWD ; git reset --hard)
0 commit comments