Merge "Add Functest execution after APEX deployment"
authorMorgan Richomme <morgan.richomme@orange.com>
Fri, 27 Nov 2015 13:56:54 +0000 (13:56 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Fri, 27 Nov 2015 13:56:54 +0000 (13:56 +0000)
18 files changed:
docs/etc/conf.py
docs/how-to-use-docs/documentation-example.rst
docs/how-to-use-docs/index.rst
docs/jenkins-job-builder/index.rst
docs/jenkins-job-builder/opnfv-jjb-usage.rst
jjb/fuel/fuel-build.sh
jjb/fuel/fuel-deploy-virtual.sh
jjb/fuel/fuel-deploy.sh
jjb/fuel/fuel.yml
jjb/functest/functest-docker.sh [deleted file]
jjb/opnfv/opnfv-docker.sh [new file with mode: 0644]
jjb/opnfv/opnfv-docker.yml [moved from jjb/functest/functest-docker.yml with 66% similarity]
jjb/opnfv/opnfv-docs.yml
jjb/releng-jobs.yaml
jjb/releng-macros.yaml
jjb/storperf/storperf.yml
jjb/vswitchperf/vswitchperf.yml
utils/jenkins-jnlp-connect.sh

index 68e847e..f42b110 100644 (file)
@@ -1,29 +1,27 @@
-import datetime
-import sys
-import os
+'''
+Base configuration file for sphinx-build.
 
-needs_sphinx = '1.3'
+You can override this configuration by putting 'conf.py' in the document
+directory (e.g. how-to-use-docs/conf.py). If there is no 'conf.py' in the
+document directory, this file will be copied to that directory before the
+document builder jobs in 'opnfv-docs-verify' and 'opnfv-docs-merge'.
+The logo image (opnfv-logo.png) will be also copied from
+docs/etc/opnfv-logo.png during the build jobs.
+'''
 
-numfig = True
+import datetime
 
-source_suffix = '.rst'
+needs_sphinx = '1.3'
 master_doc = 'index'
 pygments_style = 'sphinx'
+
 html_use_index = False
+numfig = True
 html_logo = 'opnfv-logo.png'
 
-pdf_documents = [('index', u'Copper', u'Copper Project', u'OPNFV')]
-pdf_fit_mode = "shrink"
-pdf_stylesheets = ['sphinx','kerning','a4']
-#latex_domain_indices = False
-#latex_use_modindex = False
-
-latex_elements = {
-    'printindex': '',
-}
+latex_elements = {'printindex': ''}
 latex_logo = 'opnfv-logo.png'
 
-project = u'Copper: Virtual Infrastructure Deployment Policies'
 copyright = u'%s, OPNFV' % datetime.date.today().year
 version = u'1.0.0'
 release = u'1.0.0'
index 764b546..e18ce59 100644 (file)
@@ -1,5 +1,3 @@
-.. two dots create a comment. please leave this logo at the top of each of your rst files.
-
 How to create documentation for your OPNFV project
 ==================================================
 
@@ -21,8 +19,9 @@ This index file must refence your other rst files.
 
 .. code-block:: bash
 
-  Example Documentation table of contents
-  =======================================
+  =====================
+  Example Documentation
+  =====================
 
   Contents:
 
@@ -32,10 +31,8 @@ This index file must refence your other rst files.
 
      documentation-example.rst
 
-  Indices and tables
-  ==================
-
-  * :ref:`search`
+  ..
+      Leave these at the bottom of 'index.rst' file
 
   Revision: _sha1_
 
@@ -53,7 +50,7 @@ For verify jobs a link to the documentation will show up as a comment in gerrit
 
 * Merge jobs
 
-Once you are happy with the look of your documentation you can submit the patchset the merge job will 
+Once you are happy with the look of your documentation you can submit the patchset the merge job will
 copy the output of each documentation directory to http://artifacts.opnfv.org/$project/docs/$name_of_your_folder/index.html
 
 Here are some quick examples of how to use rst markup
@@ -71,10 +68,3 @@ links are easy to add: Here is a link to sphinx, the tool that we are using to g
 .. code-block:: bash
 
   echo "Heres is a code block with bash syntax highlighting"
-
-
-Leave these at the bottom of each of your documents they are used internally
-
-Revision: _sha1_
-
-Build date: |today|
index 2d49331..0965eb3 100644 (file)
@@ -1,12 +1,9 @@
-.. OPNFV Release Engineering documentation, created by
-   sphinx-quickstart on Tue Jun  9 19:12:31 2015.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
+..
+    This is new template created on Thu Nov 26 16:18:09 JST 2015
 
-Example Documentation table of contents
-=======================================
-
-Contents:
+=====================
+Example Documentation
+=====================
 
 .. toctree::
    :numbered:
@@ -14,10 +11,8 @@ Contents:
 
    documentation-example.rst
 
-Indices and tables
-==================
-
-* :ref:`search`
+..
+    Leave these at the bottom of 'index.rst' file
 
 Revision: _sha1_
 
index 05847a1..f8f5683 100644 (file)
@@ -1,24 +1,13 @@
-.. OPNFV Release Engineering documentation, created by
-   sphinx-quickstart on Tue Jun  9 19:12:31 2015.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
+===========================
 Release Engineering Project
 ===========================
 
-Contents:
-
 .. toctree::
    :numbered:
    :maxdepth: 8
 
    opnfv-jjb-usage.rst
 
-Indices and tables
-==================
-
-* :ref:`search`
-
 Revision: _sha1_
 
 Build date: |today|
index 1945490..4aecc6d 100644 (file)
@@ -60,22 +60,22 @@ The Current merge and verify jobs for jenkins job builder as pulled from the rep
      jobs:
          - 'builder-verify-jjb'
          - 'builder-merge'
+
      project: 'releng'
+
  - job-template:
      name: builder-verify-jjb
+
      node: master
+
      project-type: freestyle
+
      logrotate:
          daysToKeep: 30
          numToKeep: 10
          artifactDaysToKeep: -1
          artifactNumToKeep: -1
+
      parameters:
          - project-parameter:
              project: '{project}'
@@ -86,11 +86,11 @@ The Current merge and verify jobs for jenkins job builder as pulled from the rep
              credentials-id: '{ssh-credentials}'
              refspec: '$GERRIT_REFSPEC'
              choosing-strategy: 'gerrit'
+
      wrappers:
          - ssh-agent-credentials:
              user: '{ssh-credentials}'
+
      triggers:
          - gerrit:
              trigger-on:
@@ -114,45 +114,45 @@ The Current merge and verify jobs for jenkins job builder as pulled from the rep
                        pattern: jjb/**
                      - compare-type: ANT
                        pattern: jjb-templates/**
+
+
      builders:
          - shell:
              !include-raw verify-releng
+
  - job-template:
      name: 'builder-merge'
+
      node: master
+
      # builder-merge job to run JJB update
      #
      # This job's purpose is to update all the JJB
+
      project-type: freestyle
+
      logrotate:
          daysToKeep: 30
          numToKeep: 40
          artifactDaysToKeep: -1
          artifactNumToKeep: 5
+
      parameters:
          - project-parameter:
              project: '{project}'
          - gerrit-parameter:
              branch: 'master'
+
      scm:
          - gerrit-trigger-scm:
              credentials-id: '{ssh-credentials}'
              refspec: ''
              choosing-strategy: 'default'
+
      wrappers:
          - ssh-agent-credentials:
              user: '{ssh-credentials}'
+
      triggers:
          - gerrit:
              trigger-on:
@@ -168,15 +168,10 @@ The Current merge and verify jobs for jenkins job builder as pulled from the rep
                  file-paths:
                      - compare-type: ANT
                        pattern: jjb/**
+
      builders:
          - shell: |
                  source /opt/virtualenv/jenkins-job-builder/bin/activate
                  cd /opt/jenkins-ci/releng
                  git pull
                  jenkins-jobs update --delete-old jjb/
-
-
-Revision: _sha1_
-
-Build date: |today| 
index cffd867..00617ce 100755 (executable)
@@ -19,9 +19,16 @@ else
     export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
 fi
 
+NOCACHE_PATTERN="verify: no-cache"
+if [[ "$JOB_NAME" =~ "verify" && "$GERRIT_CHANGE_COMMIT_MESSAGE" =~ "$NOCACHE_PATTERN" ]]; then
+    echo "The cache will not be used for this build!"
+    NOCACHE_ARG="-f P"
+fi
+NOCACHE_ARG=${{NOCACHE_ARG:-}}
+
 # start the build
-cd $WORKSPACE/$INSTALLER/ci
-./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
+cd $WORKSPACE/ci
+./build.sh -v $OPNFV_ARTIFACT_VERSION $NOCACHE_ARG -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
 
 # list the build artifacts
 ls -al $BUILD_DIRECTORY
index ff4f8c3..a65395b 100755 (executable)
@@ -18,7 +18,7 @@ chmod a+x $HOME
 chmod a+x $TMPDIR
 
 # set CONFDIR, BRIDGE
-CONFDIR=$WORKSPACE/fuel/deploy/templates/virtual_environment/conf
+CONFDIR=$WORKSPACE/deploy/templates/virtual_environment/conf
 BRIDGE=pxebr
 
 # log info to console
@@ -28,9 +28,9 @@ echo
 
 # start the deployment
 echo "Issuing command"
-echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
+echo "sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
 
-sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
+sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
 
 echo
 echo "--------------------------------------------------------"
index 2ec5195..b617bcf 100755 (executable)
@@ -18,7 +18,7 @@ chmod a+x $HOME
 chmod a+x $TMPDIR
 
 # set CONFDIR, BRIDGE
-CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
+CONFDIR=$WORKSPACE/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
 BRIDGE=pxebr
 
 # clone genesis repo and checkout the SR1 tag
@@ -41,9 +41,9 @@ echo
 
 # start the deployment
 echo "Issuing command"
-echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
+echo "sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
 
-sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
+sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
 
 echo
 echo "--------------------------------------------------------"
index 60a69c6..40fd46d 100644 (file)
@@ -87,6 +87,7 @@
                 branches:
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/{branch}'
+            readable-message: true
 
     builders:
         - shell:
diff --git a/jjb/functest/functest-docker.sh b/jjb/functest/functest-docker.sh
deleted file mode 100644 (file)
index c73bcf9..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-set -o errexit
-set -o nounset
-set -o pipefail
-
-
-echo "Starting the build of Functest Docker."
-echo "--------------------------------------------------------"
-echo
-
-DOCKER_IMAGE_NAME="opnfv/functest"
-
-
-# Get tag version
-cd $WORKSPACE
-git clone https://gerrit.opnfv.org/gerrit/releng
-
-DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \
-    -n $DOCKER_IMAGE_NAME)
-
-ret_val=$?
-if [ $ret_val -ne 0 ]; then
-    echo "Error retrieving the version tag."
-    exit 1
-else
-    echo "Tag version to be build and pushed: $DOCKER_TAG"
-fi
-
-
-# Remove previous running containers if exist
-if [[ ! -z $(docker ps -a | grep $DOCKER_IMAGE_NAME) ]]; then
-    echo "Removing existing $DOCKER_IMAGE_NAME containers..."
-    docker ps | grep $DOCKER_IMAGE_NAME | awk '{{print $1}}' | xargs docker stop
-    docker ps -a | grep $DOCKER_IMAGE_NAME | awk '{{print $1}}' | xargs docker rm
-fi
-
-
-# Remove existing images if exist
-if [[ ! -z $(docker images | grep $DOCKER_IMAGE_NAME) ]]; then
-    echo "Docker images to remove:"
-    docker images | head -1 && docker images | grep $DOCKER_IMAGE_NAME
-    image_tags=($(docker images | grep $DOCKER_IMAGE_NAME | awk '{{print $2}}'))
-    for tag in "${{image_tags[@]}}"; do
-        echo "Removing docker image $DOCKER_IMAGE_NAME:$tag..."
-        docker rmi $DOCKER_IMAGE_NAME:$tag
-    done
-fi
-
-
-# Start the build
-echo "Building docker image: $DOCKER_IMAGE_NAME:$DOCKER_TAG..."
-cd $WORKSPACE/docker
-docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG .
-echo "Creating tag 'latest'..."
-docker tag $DOCKER_IMAGE_NAME:$DOCKER_TAG $DOCKER_IMAGE_NAME:latest
-
-# list the images
-echo "Available images are:"
-docker images
-
-
-if [ "$PUSH_IMAGE" == "true" ]; then
-    echo "Pushing $DOCKER_IMAGE_NAME:$DOCKER_TAG to the docker registry..."
-    echo "--------------------------------------------------------"
-    echo
-    # Push to the Dockerhub repository
-    docker push $DOCKER_IMAGE_NAME:$DOCKER_TAG
-
-    echo "Updating $DOCKER_IMAGE_NAME:latest to the docker registry..."
-    docker push $DOCKER_IMAGE_NAME:latest
-fi
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
new file mode 100644 (file)
index 0000000..2b42938
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+
+echo "Starting opnfv-docker for $DOCKER_REPO_NAME ..."
+echo "--------------------------------------------------------"
+echo
+
+
+# Remove previous running containers if exist
+if [[ ! -z $(docker ps -a | grep $DOCKER_REPO_NAME) ]]; then
+    echo "Removing existing $DOCKER_REPO_NAME containers..."
+    docker ps | grep $DOCKER_REPO_NAME | awk '{{print $1}}' | xargs docker stop
+    docker ps -a | grep $DOCKER_REPO_NAME | awk '{{print $1}}' | xargs docker rm
+fi
+
+
+# Remove existing images if exist
+if [[ ! -z $(docker images | grep $DOCKER_REPO_NAME) ]]; then
+    echo "Docker images to remove:"
+    docker images | head -1 && docker images | grep $DOCKER_REPO_NAME
+    image_tags=($(docker images | grep $DOCKER_REPO_NAME | awk '{{print $2}}'))
+    for tag in "${{image_tags[@]}}"; do
+        echo "Removing docker image $DOCKER_REPO_NAME:$tag..."
+        docker rmi $DOCKER_REPO_NAME:$tag
+    done
+fi
+
+# If we just want to update the latest_stable image
+if [[ "$UPDATE_LATEST_STABLE" == "true" ]]; then
+    echo "Pulling $DOCKER_REPO_NAME:$STABLE_TAG ..."
+    docker pull $DOCKER_REPO_NAME:$STABLE_TAG
+    if [[ $? -ne 0 ]]; then
+        echo "ERROR: The image $DOCKER_REPO_NAME with tag $STABLE_TAG does not exist."
+        exit 1
+    fi
+    docker tag $DOCKER_REPO_NAME:$STABLE_TAG $DOCKER_REPO_NAME:latest_stable
+    echo "Pushing $DOCKER_REPO_NAME:latest_stable ..."
+    docker push $DOCKER_REPO_NAME:latest_stable
+    exit 0
+fi
+
+
+# Get tag version
+cd $WORKSPACE
+git clone https://gerrit.opnfv.org/gerrit/releng
+
+DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \
+    -n $DOCKER_REPO_NAME)
+
+ret_val=$?
+if [ $ret_val -ne 0 ]; then
+    echo "Error retrieving the version tag."
+    exit 1
+else
+    echo "Tag version to be build and pushed: $DOCKER_TAG"
+fi
+
+
+# cd to directory where Dockerfile is located
+if [[ "$DOCKER_REPO_NAME" == "opnfv/functest" ]]; then
+    cd $WORKSPACE/docker
+elif [[ "$DOCKER_REPO_NAME" == "opnfv/yardstick" ]]; then
+    cd $WORKSPACE/ci/docker/yardstick-ci
+else
+    echo "ERROR: DOCKER_REPO_NAME parameter not valid: $DOCKER_REPO_NAME"
+    exit 1
+fi
+
+# Start the build
+echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG..."
+
+docker build -t $DOCKER_REPO_NAME:$DOCKER_TAG .
+echo "Creating tag 'latest'..."
+docker tag $DOCKER_REPO_NAME:$DOCKER_TAG $DOCKER_REPO_NAME:latest
+
+# list the images
+echo "Available images are:"
+docker images
+
+# Push image to Dockerhub
+if [[ "$PUSH_IMAGE" == "true" ]]; then
+    echo "Pushing $DOCKER_REPO_NAME:$DOCKER_TAG to the docker registry..."
+    echo "--------------------------------------------------------"
+    echo
+    # Push to the Dockerhub repository
+    docker push $DOCKER_REPO_NAME:$DOCKER_TAG
+
+    echo "Updating $DOCKER_REPO_NAME:latest to the docker registry..."
+    docker push $DOCKER_REPO_NAME:latest
+fi
similarity index 66%
rename from jjb/functest/functest-docker.yml
rename to jjb/opnfv/opnfv-docker.yml
index ee5adc6..dfff050 100644 (file)
@@ -1,15 +1,17 @@
 ##############################################
-# job configuration for functest docker build
+# job configuration for docker build and push
 ##############################################
 
 - project:
 
-    name: functest-docker
+    name: opnfv-docker
 
-    project: 'functest'
+    project:
+        - 'functest'
+        - 'yardstick'
 
     jobs:
-        - 'functest-docker-build-push-{stream}'
+        - '{project}-docker-build-push-{stream}'
 
     stream:
         - master:
@@ -18,9 +20,8 @@
 ########################
 # job templates
 ########################
-
 - job-template:
-    name: 'functest-docker-build-push-{stream}'
+    name: '{project}-docker-build-push-{stream}'
 
     project-type: freestyle
 
     parameters:
         - project-parameter:
             project: '{project}'
-        - functest-docker-parameter
-
+        - string:
+            name: GIT_BASE
+            default: "https://gerrit.opnfv.org/gerrit/$PROJECT"
+            description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
+        - string:
+            name: PUSH_IMAGE
+            default: "true"
+            description: "To enable/disable pushing the image to Dockerhub."
+        - string:
+            name: BASE_VERSION
+            default: "brahmaputra.0"
+            description: "Base version to be used."
+        - string:
+            name: DOCKER_REPO_NAME
+            default: "opnfv/{project}"
+            description: "Dockerhub repo to be pushed to."
+        - string:
+            name: UPDATE_LATEST_STABLE
+            default: "false"
+            description: "This will update the latest_stable image only."
+        - string:
+            name: STABLE_TAG
+            description: "If above option is true, this is the tag to be pulled."
 
     scm:
         - git-scm:
 
     builders:
         - shell:
-            !include-raw ./functest-docker.sh
+            !include-raw ./opnfv-docker.sh
 
     triggers:
         - pollscm: "*/30 * * * *"
-
-
-########################
-# parameter macros
-########################
-- parameter:
-    name: functest-docker-parameter
-    parameters:
-        - string:
-            name: GIT_BASE
-            default: "https://gerrit.opnfv.org/gerrit/$PROJECT"
-            description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
-        - string:
-            name: PUSH_IMAGE
-            default: "true"
-            description: "To enable/disable pushing the image to Dockerhub."
-        - string:
-            name: BASE_VERSION
-            default: "brahmaputra.0"
-            description: "Base version to be used."
index c6b6f8d..0cc9420 100644 (file)
@@ -74,8 +74,7 @@
                     pattern: 'docs/**'
 
     builders:
-        - build-html-and-pdf-docs-output
-        - upload-under-review-docs-to-opnfv-artifacts
+        - upload-review-docs
 
 - job-template:
     name: 'opnfv-docs-merge'
                     pattern: 'docs/**'
 
     builders:
-        - build-html-and-pdf-docs-output
-        - upload-merged-docs-to-opnfv-artifacts
-        - remove-old-docs-from-opnfv-artifacts
+        - upload-merged-docs
index d732b1f..40f05bf 100644 (file)
@@ -59,9 +59,6 @@
                       pattern: jjb-templates/**
                     - compare-type: ANT
                       pattern: utils/**
-                forbidden-file-paths:
-                    - compare-type: ANT
-                      pattern: docs/**
 
 
     builders:
                       pattern: jjb/**
                     - compare-type: ANT
                       pattern: utils/**
-                forbidden-file-paths:
-                    - compare-type: ANT
-                      pattern: docs/**
 
     builders:
         - shell: |
index 3be93c8..3afe848 100644 (file)
 
             [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
 
-            git_sha1="$(git rev-parse HEAD)"
-
-            find docs/ -type f -iname '*.rst' -print0 | while read file
-            do
-                sed -i "s/_sha1_/$git_sha1/g" "$file"
-            done
+            _get_title_script="
+            import os
+            from docutils import core, nodes
+            with open('index.rst', 'r') as file:
+                data = file.read()
+            doctree = core.publish_doctree(data,
+                settings_overrides={'report_level': 5,
+                                    'halt_level': 5})
+            if isinstance(doctree[0], nodes.title):
+                title = doctree[0]
+            else:
+                for c in doctree.children:
+                    if isinstance(c, nodes.section):
+                        title = c[0]
+                        break
+            print title.astext()"
+            _git_sha1="$(git rev-parse HEAD)"
+
+            git clone ssh://gerrit.opnfv.org:29418/releng
+            [[ -d releng ]]
 
             find docs/ -name 'index.rst' -printf '%h\n' | while read dir
             do
                 echo "#################${dir//?/#}"
                 echo
 
-                mkdir -p "$_output"
+                sed -i "s/_sha1_/$_git_sha1/g" "$dir/index.rst"
 
-                sphinx-build -b html -E -c docs/etc "$dir" "$_output"
+                if [[ ! -f "$dir/conf.py" ]] ; then
+                    cp releng/docs/etc/conf.py "$dir/conf.py"
+                    _title=$(cd $dir; python -c "$_get_title_script")
+                    echo "latex_documents = [('index', '$_name.tex', \"$_title\", 'OPNFV', 'manual'),]" >> "$dir/conf.py"
+                fi
+                cp -f releng/docs/etc/opnfv-logo.png "$dir/opnfv-logo.png"
 
-                #sphinx-build -b latex -E -c docs/etc -D project=$_name "$dir" "$_build"
-                #make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
-                #mv "$_build"/*.pdf "$_output"
+                mkdir -p "$_output"
+
+                sphinx-build -b html -E "$dir" "$_output"
+
+                # Note: PDF creation may fail in project doc builds.
+                #       We allow this test to be marked as succeeded with
+                #       failure in PDF creation, but leave message to fix it.
+                #       Any failure has to be fixed before B release.
+                {
+                    sphinx-build -b latex -E "$dir" "$_build"
+                    make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
+                    mv "$_build/$_name.pdf" "$_output"
+                } || {
+                    _msg="Error: PDF creation for $dir has failed, please fix source rst file(s)."
+                    echo
+                    echo "$_msg"
+                    echo
+                    echo "$_msg" >> gerrit_comment.txt
+                }
             done
 
-#TODO(r-mibu): change this to publisher
 - builder:
     name: upload-under-review-docs-to-opnfv-artifacts
     builders:
             echo "###########################"
             echo
 
-            gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
+            gs_base="artifacts.opnfv.org/review"
+            gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
+            local_path="docs/$GERRIT_CHANGE_NUMBER"
 
-            gsutil -m cp -r docs/output/* "gs://$gs_path"
+            mv docs/output "$local_path"
+            gsutil -m cp -r "$local_path" "gs://$gs_base"
 
             if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
                 gsutil -m setmeta \
                     "gs://$gs_path"/**.html
             fi
 
-            files=$(find docs/output | grep -e 'index.html$' -e 'pdf$' | \
-                    sed -e "s|^docs/output|    http://$gs_path|")
-            gerrit_comment="Document link(s):
-            $files"
-            echo
-            echo "$gerrit_comment"
-            echo
-            ssh -p 29418 gerrit.opnfv.org "gerrit review -p $GERRIT_PROJECT -m '$gerrit_comment' $GERRIT_PATCHSET_REVISION"
+            echo "Document link(s):" >> gerrit_comment.txt
+            find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
+                sed -e "s|^$local_path|    http://$gs_path|" >> gerrit_comment.txt
 
-#TODO(r-mibu): change this to publisher
 - builder:
     name: upload-merged-docs-to-opnfv-artifacts
     builders:
             echo
 
             if [[ "$GERRIT_BRANCH" == "master" ]] ; then
-                gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/docs"
+                gs_base="artifacts.opnfv.org/$GERRIT_PROJECT"
             else
-                gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH/docs"
+                gs_base="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH"
             fi
+            gs_path="$gs_base/docs"
+            local_path="docs/docs"
 
-            gsutil -m cp -r docs/output/* "gs://$gs_path"
+            mv docs/output "$local_path"
+            gsutil -m cp -r "$local_path" "gs://$gs_base"
 
             if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
                 gsutil -m setmeta \
                     "gs://$gs_path"/**.html
             fi
 
-            files=$(find docs/output | grep -e 'index.html$' -e 'pdf$' | \
-                    sed -e "s|^docs/output|    http://$gs_path|")
-            gerrit_comment="Document link(s):
-            $files"
-            echo
-            echo "$gerrit_comment"
-            echo
-            ssh -p 29418 gerrit.opnfv.org "gerrit review -p $GERRIT_PROJECT -m '$gerrit_comment' $GERRIT_PATCHSET_REVISION"
+            echo "Document link(s):" >> gerrit_comment.txt
+            find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
+                sed -e "s|^$local_path|    http://$gs_path|" >> gerrit_comment.txt
+
+- builder:
+    name: report-docs-build-result-to-gerrit
+    builders:
+        - shell: |
+            #!/bin/bash -e
+            export PATH=$PATH:/usr/local/bin/
+            if [[ -e gerrit_comment.txt ]] ; then
+                echo
+                echo "posting review comment to gerrit..."
+                echo
+                cat gerrit_comment.txt
+                echo
+                ssh -p 29418 gerrit.opnfv.org \
+                    "gerrit review -p $GERRIT_PROJECT \
+                     -m '$(cat gerrit_comment.txt)' \
+                     $GERRIT_PATCHSET_REVISION"
+            fi
 
-#TODO(r-mibu): change this to publisher
 - builder:
     name: remove-old-docs-from-opnfv-artifacts
     builders:
                 echo "Deleting Out-of-dated Documents..."
                 gsutil -m rm -r "gs://$gs_path"
             fi
+
+- builder:
+    name: upload-review-docs
+    builders:
+        - build-html-and-pdf-docs-output
+        - upload-under-review-docs-to-opnfv-artifacts
+        - report-docs-build-result-to-gerrit
+
+- builder:
+    name: upload-merged-docs
+    builders:
+        - build-html-and-pdf-docs-output
+        - upload-merged-docs-to-opnfv-artifacts
+        - report-docs-build-result-to-gerrit
+        - remove-old-docs-from-opnfv-artifacts
index 681541d..1d50911 100644 (file)
@@ -16,7 +16,7 @@
 - job-template:
     name: 'storperf-verify-{stream}'
 
-    node: ericsson-build
+    node: intel-jp-build-1
 
     project-type: freestyle
 
@@ -77,7 +77,7 @@
     #
     # This job's purpose is to update all the JJB
 
-    node: ericsson-build
+    node: intel-jp-build-1
 
     project-type: freestyle
 
     # Required Variables:
     #     stream:    branch with - in place of / (eg. stable)
     #     branch:    branch (eg. stable)
-    node: ericsson-build
+    node: intel-jp-build-1
 
     disabled: true
 
index 07ce114..6cc00f5 100644 (file)
@@ -1,10 +1,9 @@
 - project:
     name: vswitchperf
     jobs:
-        - 'vswitchperf-test'
         - 'vswitchperf-daily-{stream}'
-        - 'vswitchperf-merge'
-        - 'vswitchperf-verify'
+        - 'vswitchperf-merge-{stream}'
+        - 'vswitchperf-verify-{stream}'
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
     project: 'vswitchperf'
     somevar: 'foo'
 
-- job-template:
-    name: vswitchperf-test
-
-    project-type: freestyle
-
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    builders:
-        - shell: |
-            echo "Hello world from vswitchperf"
 
 - job-template:
     name: 'vswitchperf-daily-{stream}'
@@ -41,7 +26,7 @@
 
     project-type: freestyle
     varsetabove: '{somevar}'
-    node: ericsson-build
+    node: opnfv-build
 
     logrotate:
         daysToKeep: '{build-days-to-keep}'
         - test-macro
 
 - job-template:
-    name: 'vswitchperf-verify'
+    name: 'vswitchperf-verify-{stream}'
 
     project-type: freestyle
-    node: ericsson-build
+
+    node: opnfv-build
+
+    concurrent: true
+
+    properties:
+        - throttle:
+            enabled: true
+            max-total: 3
+            max-per-node: 2
 
     logrotate:
         daysToKeep: 30
             make sanity
 
 - job-template:
-    name: 'vswitchperf-merge'
+    name: 'vswitchperf-merge-{stream}'
 
     # builder-merge job to run JJB update
     #
     # This job's purpose is to update all the JJB
 
     project-type: freestyle
-    node: ericsson-build
+
+    node: opnfv-build
+
+    concurrent: true
+
+    properties:
+        - throttle:
+            enabled: true
+            max-total: 3
+            max-per-node: 2
 
     logrotate:
         daysToKeep: 30
index d263b19..00c1997 100755 (executable)
@@ -100,7 +100,7 @@ fi
 
 if [[ $started_monit == "true" ]]; then
 wget --timestamping https://build.opnfv.org/ci/jnlpJars/slave.jar && true
-chown $jenkinsuser $jenkinsuser slave.jar
+chown $jenkinsuser:$jenkinsuser slave.jar
 
 if [[ -f /var/run/$jenkinsuser/jenkins_jnlp_pid ]];
 then echo "pid file found"