Create Stable Branch Jobs for opnfvdocs
[releng.git] / jjb / opnfvdocs / docs-rtd.yaml
index 28f9354..fbf2969 100644 (file)
@@ -8,6 +8,10 @@
     stream:
       - master:
           branch: 'master'
+      - gambia:
+          branch: 'stable/{stream}'
+      - fraser:
+          branch: 'stable/{stream}'
       - danube:
           branch: 'stable/{stream}'
       - euphrates:
@@ -27,6 +31,8 @@
           name: SLAVE_LABEL
           default: 'lf-build1'
           description: 'Slave label on Jenkins'
+          all-nodes: false
+          node-eligibility: 'ignore-offline'
       - project-parameter:
           project: '{project}'
           branch: '{branch}'
@@ -58,6 +64,8 @@
           name: SLAVE_LABEL
           default: 'lf-build2'
           description: 'Slave label on Jenkins'
+          all-nodes: false
+          node-eligibility: 'ignore-offline'
       - project-parameter:
           project: '{project}'
           branch: '{branch}'
           server: 'gerrit.opnfv.org'
           project: '**'
           branch: '{branch}'
-          files: 'docs/**/*.*'
+          files: 'docs/**'
 
     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
+              cd -
           else
               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
           fi
+          if [ -d docs/subdmodules ]; then
+              for project in docs/submodules/*; do
+                  cd $project && git submodule deinit -f . && cd -
+              done
+          fi
       - shell: |
-          sudo pip install virtualenv
+          sudo -H pip install virtualenv
           virtualenv $WORKSPACE/venv
           . $WORKSPACE/venv/bin/activate
           pip install --upgrade pip