[docs] local docs building for missing submodules
[releng.git] / jjb / opnfvdocs / docs-rtd.yaml
index c989595..c7988e6 100644 (file)
@@ -8,6 +8,10 @@
     stream:
       - master:
           branch: 'master'
+      - fraser:
+          branch: 'stable/{stream}'
+      - danube:
+          branch: 'stable/{stream}'
       - euphrates:
           branch: 'stable/{stream}'
 
@@ -36,6 +40,7 @@
           files: 'docs/**/*.*'
 
     builders:
+      - 'remove-old-docs-from-opnfv-artifacts'
       - shell: |
           if [ $GERRIT_BRANCH == "master" ]; then
             RTD_BUILD_VERSION=latest
     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
           fi
       - shell: |
-          sudo pip install virtualenv
+          sudo -H pip install virtualenv
           virtualenv $WORKSPACE/venv
           . $WORKSPACE/venv/bin/activate
           pip install --upgrade pip
           pip freeze
           pip install tox
+          sed -i s,\-b\ html,\-b\ singlehtml,g tox.ini
           tox -edocs
+      - 'upload-review-docs'