This patch includes scripts to enhance the apex build support feature
[kvmfornfv.git] / ci / apex_build.sh
index 5b81840..abeac7f 100755 (executable)
@@ -5,13 +5,18 @@ build_dir=/opt/kvmfornfv/
 mkdir -p /tmp/kvmfornfv
 SRC=/tmp/kvmfornfv
 source ${build_dir}/ci/apex.conf
+#Cloning into /tmp/kvmfornfv
 cd $SRC
-#Cloning into /tmp/kvmfornfv from local repository
-git clone $build_dir $SRC
-if [ "$branch" == "master" ] || [ "$branch" == "danube" ];then
-   echo "Checking out on $branch branch"
+if [[ "$branch" == "master" ]] || [[ "$branch" == *"danube"* ]];then
+   echo "Cloning the repository of $branch given"
+   git clone -b $branch https://gerrit.opnfv.org/gerrit/kvmfornfv.git /tmp/kvmfornfv
+   git branch
    echo "Commit-id is ${commit_id}"
    git checkout -f ${commit_id}
+   if [ $? -ne 0 ];then
+      echo "Please check the commit-id provided in apex.conf"
+      exit 1
+   fi
 fi
 mkdir ${output_dir}
 }