diff options
author | Zhijiang Hu <hu.zhijiang@zte.com.cn> | 2017-10-26 00:23:45 -0400 |
---|---|---|
committer | Zhijiang Hu <hu.zhijiang@zte.com.cn> | 2017-10-26 09:38:02 +0000 |
commit | e422c79b1e7071f80711ada90fd9f800c0e0001d (patch) | |
tree | 157171fbbd87b06a20008ffc6d2d4d419b1a1f70 /ci | |
parent | e9b3657808ab47a9478fa5137abb27cbede11ad2 (diff) |
Support work dir and jobname parameter
Change-Id: I6ce45197e01d278a41b9472d0bb92f037ab7d0c6
Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
(cherry picked from commit b47b3753c63ba9d28d5a11efb1bb4ce3932d3f1a)
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/kolla-build.sh | 33 |
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 |