Krinkle has submitted this change and it was merged. Change subject: Build script for mediawiki documentation ......................................................................
Build script for mediawiki documentation This patch implements the mw-doc-gen.sh tool. It builds MediaWiki documentation for tags and branches (based on ZUUL_REF) and publishes to https://doc.wikimedia.org/. Change-Id: I5dd693c81b28dc8d5231482a914fedf2518a1bb2 --- A tools/mw-doc-gen.sh 1 file changed, 57 insertions(+), 0 deletions(-) Approvals: Krinkle: Verified; Looks good to me, approved diff --git a/tools/mw-doc-gen.sh b/tools/mw-doc-gen.sh new file mode 100755 index 0000000..5b352e0 --- /dev/null +++ b/tools/mw-doc-gen.sh @@ -0,0 +1,57 @@ +#!/bin/bash -e +# +# A wrapper around MediaWiki core documentation generator used to creates +# documentation for master, release branches and release tags. +# +# Copyright, All rights reserved. +# - Wikimedia Foundation, 2012-2013 +# - Antoine "hashar" Musso, 2012-2013 +# - Timo Tijhof, 2012-2013 +# +# Licensed under GPL v2.0 + + +# Will hold the tag or branch +TARGET_NAME="" + +if [[ "$ZUUL_REF" =~ ^refs/tags/(.*) ]]; then + TARGET_NAME="${BASH_REMATCH[1]}" +elif [[ "$ZUUL_REF" =~ ^(master|REL[0-9]+_[0-9]+)$ ]]; then + TARGET_NAME="${BASH_REMATCH[1]}" +fi + +if [ -z "$TARGET_NAME" ]; then + echo "Error: Change target reference is not a tag or a recognized branch." + echo "\$ZUUL_REF: $ZUUL_REF" + exit 1 +fi + +if [ ! -e "$WORKSPACE/maintenance/mwdocgen.php" ]; then + echo "Error: Could not find maintenance/mwdocgen.php" + echo "Make sure \$WORKSPACE points to a MediaWiki installation." + echo "\$WORKSPACE: $WORKSPACE" + exit 1 +fi + +echo "Found target: '$TARGET_NAME'" + +# Destination where the generated files will eventually land. +# For example: +# http://doc.wikimedia.org/mediawiki-core/master/php +# http://doc.wikimedia.org/mediawiki-core/REL1_20/php +# http://doc.wikimedia.org/mediawiki-core/1.20.2/php +DEST_DIR="/srv/org/wikimedia/doc/mediawiki-core/$TARGET_NAME/php" +[ ! -d "${DEST_DIR}" ] && mkdir -p "${DEST_DIR}" + +# Run the MediaWiki documentation wrapper +# +# We want to make sure both stdin and stderr are logged to publicly accessible +# files so users can have a look at them directly from the doc site. +# We also send back the stderr to the Jenkins console +# +# Trick explanation: the command stderr is sent as stdin to a tee FIFO which in +# turns write back to stderr. +php "$WORKSPACE/maintenance/mwdocgen.php" \ + --no-extensions --output "$DEST_DIR" \ + 1 > "$DEST_DIR/console.txt" \ + 2 > >(tee "$DEST_DIR/errors.txt" >&2) -- To view, visit https://gerrit.wikimedia.org/r/39212 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5dd693c81b28dc8d5231482a914fedf2518a1bb2 Gerrit-PatchSet: 11 Gerrit-Project: integration/jenkins Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Hashar <has...@free.fr> Gerrit-Reviewer: Krinkle <ttij...@wikimedia.org> Gerrit-Reviewer: saper <sa...@saper.info> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits