summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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