summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-10-26 00:23:45 -0400
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2017-10-26 04:28:39 -0400
commitb47b3753c63ba9d28d5a11efb1bb4ce3932d3f1a (patch)
treeca398a4f2483efab4ac6a211be0d8334a323f31a
parentc4860a5ba7ae7d6d3dc5dcf365e61b68d61a8265 (diff)
Support work dir and jobname parameter
Change-Id: I6ce45197e01d278a41b9472d0bb92f037ab7d0c6 Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
-rwxr-xr-xci/kolla-build.sh33
1 files changed, 29 insertions, 4 deletions
diff --git a/ci/kolla-build.sh b/ci/kolla-build.sh
index 5784a17e..2ad5437a 100755
--- a/ci/kolla-build.sh
+++ b/ci/kolla-build.sh
@@ -15,13 +15,12 @@ set -o pipefail
KOLLA_GIT="https://github.com/huzhijiang/kolla.git"
KOLLA_BRANCH="stable/ocata"
+OPNFV_JOB_NAME=
KOLLA_TAG=
EXT_TAG=
KOLLA_GIT_VERSION=
KOLLA_IMAGE_VERSION=
-KOLLA_GIT_DIR=/tmp/kolla-git
-REGISTRY_VOLUME_DIR=/tmp/registry
-BUILD_OUTPUT_DIR=/tmp/kolla-build-output
+WORK_DIR=/tmp
REGISTRY_SERVER_NAME=daisy-registry
function usage
@@ -35,19 +34,23 @@ usage: `basename $0` [options]
OPTIONS:
-l Kolla git repo location
-b Kolla git repo branch
+ -j OPNFV job name
-t Kolla git repo code tag(base version of image)
-e user defined tag extension(extended version)
+ -w working directroy
Examples:
sudo `basename $0` -l https://git.openstack.org/openstack/kolla
-b stable/ocata
+ -j daisy-docker-build-euphrates
-t 4.0.2
-e 1
+ -w /tmp
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
}
-while getopts "l:b:t:e:h" OPTION
+while getopts "l:b:j:t:e:h" OPTION
do
case $OPTION in
l)
@@ -56,12 +59,18 @@ do
b)
KOLLA_BRANCH=${OPTARG}
;;
+ j)
+ OPNFV_JOB_NAME=${OPTARG}
+ ;;
t)
KOLLA_TAG=${OPTARG}
;;
e)
EXT_TAG=${OPTARG}
;;
+ w)
+ WORK_DIR=${OPTARG}
+ ;;
h)
usage
exit 0
@@ -74,6 +83,22 @@ do
esac
done
+KOLLA_GIT_DIR=$WORK_DIR/kolla-git
+REGISTRY_VOLUME_DIR=$WORK_DIR/registry
+BUILD_OUTPUT_DIR=$WORK_DIR/kolla-build-output
+
+# OPNFV_JOB_NAME overwrites KOLLA_BRANCH
+if [[ ! -z "$OPNFV_JOB_NAME" ]]; then
+ if [[ "$OPNFV_JOB_NAME" =~ "euphrates" ]]; then
+ KOLLA_BRANCH="stable/ocata"
+ elif [[ "$OPNFV_JOB_NAME" =~ "fraser" ]]; then
+ KOLLA_BRANCH="stable/pike"
+ else
+ # For master branch
+ KOLLA_BRANCH="stable/pike"
+fi
+
+
function pre_check {
echo "Pre setup"
if [ $KOLLA_BRANCH == "stable/mitaka" ] ; then