[docs] local docs building for missing submodules 11/62911/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 24 Sep 2018 19:21:10 +0000 (21:21 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 24 Sep 2018 19:31:30 +0000 (21:31 +0200)
Some projects already moved away from OPNFV Docs git submodules.
The proposed hack has a couple of problems:
- it still downloads all of OPNFV docs + submodules (recursively!);
- it uses Jenkins to handle gerrit clone/fetch, just to nuke it and
  clone the current project again;
But:
- it is a small change, to be replaced when global-jjb will support
  gsutil upload for docs preview;
- it provides a locally built preview document instead of the old
  (complete) doc preview;

Change-Id: I7426679187eb1cfabb181c59da61f3b794e50e5f
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
jjb/opnfvdocs/docs-rtd.yaml

index fc99bd3..c7988e6 100644 (file)
     builders:
       - shell: |
           if [ "$GERRIT_PROJECT" != "opnfvdocs" ]; then
-              cd docs/submodules/$GERRIT_PROJECT
+              # Temporary hacky solution to handle local builds for projects
+              # that already moved away from submodules
+              if ! cd docs/submodules/$GERRIT_PROJECT 2 > /dev/null; then
+                  rm -rf .* * 2 > /dev/null
+                  git clone ${{GIT_BASE/opnfvdocs/$GERRIT_PROJECT}} .
+              fi
               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
           else
               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD