<p>osmith <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12213">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Neels Hofmeyr: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">contrib/jenkins*: build and publish manuals<br><br>Add contrib/jenkins-build-manuals.sh, which clones or updates<br>osmo-gsm-manuals and builds the manuals. When the environment variable<br>PUBLISH=1 is set, it also uploads them.<br><br>Call jenkins-build-manuals.sh from jenkins-run.sh, without PUBLISH=1,<br>so the manuals get build-tested in the osmo-gsm-tester_gerrit job.<br><br>A new job master-osmo-gsm-tester will be added in the future, which<br>will run PUBLISH=1 jenkins-build-manuals.sh.<br><br>The jenkins-build-manuals.sh script does not use the osmo-ci.git<br>scripts for installing dependencies and cleaning up the workspace.<br>These scripts are not available on the node, which runs the<br>osmo-gsm-tester_gerrit job, and it is not trivial to add just them<br>(without building the osmo-ci Docker image etc.). The only dependency<br>is osmo-gsm-manuals, and it does not need to be compiled, so it seemed<br>to be the most maintainable solution to implement the clone/update and<br>clean up in a few lines of shell code instead.<br><br>Related: OS#3385<br>Change-Id: I4ebfe12a164f807b63bc897aff44db83fc0705bd<br>---<br>A contrib/jenkins-build-manuals.sh<br>M contrib/jenkins-make-check-and-run.sh<br>2 files changed, 41 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/contrib/jenkins-build-manuals.sh b/contrib/jenkins-build-manuals.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..48f7780</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/jenkins-build-manuals.sh</span><br><span>@@ -0,0 +1,40 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh -ex</span><br><span style="color: hsl(120, 100%, 40%);">+# environment variables:</span><br><span style="color: hsl(120, 100%, 40%);">+# * PUBLISH: upload manuals after building if set to "1"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+base="$PWD"</span><br><span style="color: hsl(120, 100%, 40%);">+export OSMO_GSM_MANUALS_DIR="$base/osmo-gsm-manuals"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Sanity check</span><br><span style="color: hsl(120, 100%, 40%);">+if ! [ -d "$base/doc/manuals" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+       echo "ERROR: this script needs to be executed from the top dir of osmo-gsm-tester.git."</span><br><span style="color: hsl(120, 100%, 40%);">+     exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Clone/update osmo-gsm-manuals and wipe local modifications</span><br><span style="color: hsl(120, 100%, 40%);">+if [ -d "$OSMO_GSM_MANUALS_DIR" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ git -C "$OSMO_GSM_MANUALS_DIR" pull</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+   git clone "https://git.osmocom.org/osmo-gsm-manuals" "$OSMO_GSM_MANUALS_DIR"</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+git -C "$OSMO_GSM_MANUALS_DIR" checkout -f HEAD</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Copy manuals source to empty temp dir (so we can easily clean up afterwards)</span><br><span style="color: hsl(120, 100%, 40%);">+temp="$base/_manuals_temp"</span><br><span style="color: hsl(120, 100%, 40%);">+if [ -d "$temp" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+    rm -rf "$temp"</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+cp -r "$base/doc/manuals" "$temp"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Build the manuals</span><br><span style="color: hsl(120, 100%, 40%);">+cd "$temp"</span><br><span style="color: hsl(120, 100%, 40%);">+make</span><br><span style="color: hsl(120, 100%, 40%);">+make check</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Publish</span><br><span style="color: hsl(120, 100%, 40%);">+if [ "$PUBLISH" = "1" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+    make publish</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Clean up</span><br><span style="color: hsl(120, 100%, 40%);">+rm -r "$temp"</span><br><span>diff --git a/contrib/jenkins-make-check-and-run.sh b/contrib/jenkins-make-check-and-run.sh</span><br><span>index 3017fd4..2a9bc82 100755</span><br><span>--- a/contrib/jenkins-make-check-and-run.sh</span><br><span>+++ b/contrib/jenkins-make-check-and-run.sh</span><br><span>@@ -8,6 +8,7 @@</span><br><span> cd osmo-gsm-tester</span><br><span> make deps</span><br><span> make check</span><br><span style="color: hsl(120, 100%, 40%);">+./contrib/jenkins-build-manuals.sh</span><br><span> cd "$base"</span><br><span> </span><br><span> PATH="$base/osmo-gsm-tester/src:$PATH" \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12213">change 12213</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12213"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I4ebfe12a164f807b63bc897aff44db83fc0705bd </div>
<div style="display:none"> Gerrit-Change-Number: 12213 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>