JIRA: DOCU-2 - Adding a job to build documentation from .rst files 62/262/6
authorVictor Laza <vlaza@cloudbasesolutions.com>
Wed, 8 Apr 2015 12:05:07 +0000 (15:05 +0300)
committerVictor Laza <vlaza@cloudbasesolutions.com>
Wed, 8 Apr 2015 14:53:53 +0000 (17:53 +0300)
This job will use shell to build documentation on Spirent's lab slave
that has docutils installed

Change-Id: I3a049b3e4a70e77f3449f5f9b38b8a52a4b55fac
Signed-off-by: Victor Laza <vlaza@cloudbasesolutions.com>
jjb/opnfvdocs/build-docu.sh [new file with mode: 0644]
jjb/opnfvdocs/opnfvdocs.yml

diff --git a/jjb/opnfvdocs/build-docu.sh b/jjb/opnfvdocs/build-docu.sh
new file mode 100644 (file)
index 0000000..1ea9d0e
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+for file in $(find . -type f -iname '*.rst'); do
+       file_cut="${file%.*}"
+        html_file=$file_cut".html"
+        pdf_file=$file_cut".pdf"
+        rst2html $file > $html_file
+        rst2pdf $file -o $pdf_file
+done
index 326c27d..327747f 100644 (file)
@@ -5,6 +5,7 @@
         - 'opnfvdocs-daily-master'
         - 'opnfvdocs-merge'
         - 'opnfvdocs-verify'
+        - 'opnfvdocs-build-docs'
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
 
 
 
+- job-template:
+    name: 'opnfvdocs-build-docs'
+
+    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:
+                - change-merged-event
+                - comment-added-contains-event:
+                    comment-contains-value: 'remerge'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: 'opnfvdocs'
+                branches:
+                    - branch-compare-type: 'ANT'
+                      branch-pattern: '**/master'
+
+    builders:
+        - shell: |
+            !include-raw build-docu.sh