summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/enable_docu_gen.rst69
-rw-r--r--docs/images/smiley.pngbin0 -> 317247 bytes
-rw-r--r--docs/other_options_for_docu_gen.rst1
3 files changed, 61 insertions, 9 deletions
diff --git a/docs/enable_docu_gen.rst b/docs/enable_docu_gen.rst
index d80b75bc7..9a77da01e 100644
--- a/docs/enable_docu_gen.rst
+++ b/docs/enable_docu_gen.rst
@@ -46,14 +46,19 @@ Enter the project settings::
cd releng/jjb/<project>/
-**Create build-upload-docu.sh**
+**Create the verify & build scripts**
The script is the same for most of the projects and you can just copy it under your project in releng/jjb/<project>/
-example: cp releng/jjb/opnfvdocs/build-docu.sh releng/jjb/<your-project>/::
+example: cp releng/jjb/opnfvdocs/build-docu.sh releng/jjb/<your-project>/
+
+**docu-build.sh**::
#!/bin/bash
- project="functest"
+ set -e
+ set -o pipefail
+
+ project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
export PATH=$PATH:/usr/local/bin/
git_sha1="$(git rev-parse HEAD)"
@@ -94,13 +99,35 @@ example: cp releng/jjb/opnfvdocs/build-docu.sh releng/jjb/<your-project>/::
done
+ images=()
+ while read -r -d ''; do
+ images+=("$REPLY")
+ done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
+
+ for img in "${{images[@]}}"; do
+
+ # uploading found images
+ echo "uploading $img"
+ cat "$img" | gsutil cp -L gsoutput.txt - \
+ gs://artifacts.opnfv.org/"$project"/"$img"
+ gsutil setmeta -h "Content-Type:image/jpeg" \
+ -h "Cache-Control:private, max-age=0, no-transform" \
+ gs://artifacts.opnfv.org/"$project"/"$img"
+ cat gsoutput.txt
+ rm -f gsoutput.txt
+
+ done
+
#the double {{ in file_cut="${{file%.*}}" is to escape jjb's yaml
-**Create build-docu-verify.sh**::
+**docu-verify.sh**::
#!/bin/bash
- project="opnfvdocs"
+ set -e
+ set -o pipefail
+
+ project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
export PATH=$PATH:/usr/local/bin/
git_sha1="$(git rev-parse HEAD)"
@@ -139,30 +166,40 @@ example: cp releng/jjb/opnfvdocs/build-docu.sh releng/jjb/<your-project>/::
Make sure you have the job-templates set correctly as below.
-example: less releng/jjb/opnfvdocs/opnfvdocs.yml (pay extra attention at the "builder" sections)::
+example: less releng/jjb/opnfvdocs/opnfvdocs.yml (pay extra attention at the "builder" sections)
+
+**opnfvdocs.yml**::
- job-template:
name: 'opnfvdocs-daily-{stream}'
+
+ node: master
...
builders:
- shell:
- !include-raw build-upload-docu.sh
+ !include-raw docu-build.sh
- job-template:
name: 'opnfvdocs-verify'
+
+ node: master
...
builders:
- shell:
- !include-raw build-docu-verify.sh
+ !include-raw docu-verify.sh
- job-template:
name: 'opnfvdocs-merge'
+
+ node: master
...
builders:
- shell:
- !include-raw build-upload-docu.sh
+ !include-raw docu-build.sh
+"node: master" is important here as all documentations are built on Jenkins master node for now.
+
Please reffer to the releng repository for the correct indentation as JJB is very picky with those and also for the rest of the code that is missing in the example code and replaced by "...".
Also you must have your documentation under docs/ in the repository or gsutil will fail to copy them; for customizations you might need to addapt build-docu.sh as we did for genesis project as different documents need to go into different places.
@@ -226,6 +263,20 @@ You must include at the bottom of every document that you want to track the foll
# add one "_" at the end of each trigger variable (they have also a prefix "_") when inserting them into documents to enable auto-replacement
+**Image inclusion for artifacts**
+
+Create a folder called images in the same folder where you documentation resides and copy .jpg or .png files there, according to the guide here: https://wiki.opnfv.org/documentation
+
+Here is an example of what you need to include in the .rst files to include an image::
+
+ .. image:: images/smiley.png
+ :height: 200
+ :width: 200
+ :alt: Just a smiley face!
+ :align: left
+
+The image will be shown in both .html and .pdf resulting artifacts.
+
NOTE:
------
diff --git a/docs/images/smiley.png b/docs/images/smiley.png
new file mode 100644
index 000000000..04023d133
--- /dev/null
+++ b/docs/images/smiley.png
Binary files differ
diff --git a/docs/other_options_for_docu_gen.rst b/docs/other_options_for_docu_gen.rst
index 73d38dd92..ea6ad2598 100644
--- a/docs/other_options_for_docu_gen.rst
+++ b/docs/other_options_for_docu_gen.rst
@@ -73,3 +73,4 @@ Description: The easiest to install, the cleanest in matter of folder & files st
Revision: _sha1_
Build date: _date_
+