fix clone-opnfv-repos builder for composite-docs 59/5759/2
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Thu, 7 Jan 2016 10:02:27 +0000 (19:02 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Thu, 7 Jan 2016 10:03:42 +0000 (19:03 +0900)
This patch may fix issue that opnfvdocs job to create
OPNFV composite docs by limiting import files from other
repos to those of docs folders.

Change-Id: I7f7edba0c6ca15a80ceedd98ce6c1e36f0ce05cd
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
jjb/opnfvdocs/opnfvdocs.yml

index de48aaf..9238a8d 100644 (file)
             set -o nounset
             set -o pipefail
 
+            tmp=$WORKSPACE/composite_tmp
+            [[ -d $tmp ]] && rm -rf $tmp
+            mkdir -p $tmp
+            mkdir -p $WORKSPACE/docs/projects
+
+            pushd $tmp
+
             # clone releng repo to get repo list
-            cd $WORKSPACE
             echo "Cloning releng repo"
             git clone $GIT_CLONE_BASE/releng --branch master --depth 1 --quiet
 
-            # clone rest of the repos and checkout the branch
-            echo "Cloning repos of participating OPNFV Projects and checking out $GERRIT_BRANCH"
+            echo
+            echo "Cloning repos of participating OPNFV Projects and copying docs"
             echo
             echo "--------------------------------------------------------"
             for repo in $(grep -v '^#' $WORKSPACE/releng/jjb/opnfvdocs/project.cfg | sort); do
-                cd $WORKSPACE/docs
-                echo "    $repo"
+                echo "    $repo ($GERRIT_BRANCH)"
                 git clone $GIT_CLONE_BASE/$repo --branch $GERRIT_BRANCH --depth 1 --quiet
+                cp -r $repo/docs $WORKSPACE/docs/projects/$repo
             done
             echo "--------------------------------------------------------"
             echo
             echo "Done"
 
-            # remove releng clone in order not to cause issues for rest of the builders
-            /bin/rm -rf $WORKSPACE/releng
+            popd
+            rm -rf $tmp