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>
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