Krinkle has submitted this change and it was merged.

Change subject: mwcore-docgen: Don't hard code mediawiki-core
......................................................................


mwcore-docgen: Don't hard code mediawiki-core

(so that when test-mediawiki-docgen is temporarily enabled,
it won't override the main documentation site).

Change-Id: Ie509fcf9a616ce3394476578df28fee57d419cdc
---
M tools/mwcore-docgen.sh
1 file changed, 14 insertions(+), 7 deletions(-)

Approvals:
  Krinkle: Verified; Looks good to me, approved



diff --git a/tools/mwcore-docgen.sh b/tools/mwcore-docgen.sh
index 8a5ff4f..cc5ffe7 100755
--- a/tools/mwcore-docgen.sh
+++ b/tools/mwcore-docgen.sh
@@ -10,22 +10,28 @@
 #
 # Licensed under GPL v2.0
 
+TARGET_PROJECTDIR=`echo "$ZUUL_PROJECT" | tr '/' '-'`
+TARGET_VERSIONDIR=""
 
-# Will hold the tag or branch
-TARGET_NAME=""
+if [ -z "$TARGET_PROJECTDIR" ]; then
+       echo "Error: Project name not found."
+       echo "\$ZUUL_PROJECT: $ZUUL_PROJECT"
+       exit 1
+fi
 
 # Example values:
 # - ZUUL_REF: refs/zuul/master/Z74178670e7c5495199f8a92e92cf609c
 # - GERRIT_BRANCH: master
 if [[ "$ZUUL_REF" =~ ^refs/tags/(.*) ]]; then
-       TARGET_NAME="${BASH_REMATCH[1]}"
+       TARGET_VERSIONDIR="${BASH_REMATCH[1]}"
 elif [[ "$GERRIT_BRANCH" =~ ^(master|REL[0-9]+_[0-9]+)$ ]]; then
-       TARGET_NAME="${BASH_REMATCH[1]}"
+       TARGET_VERSIONDIR="${BASH_REMATCH[1]}"
 fi
 
-if [ -z "$TARGET_NAME" ]; then
+if [ -z "$TARGET_VERSIONDIR" ]; then
        echo "Error: Change target reference is not a tag or a recognized 
branch."
        echo "\$ZUUL_REF: $ZUUL_REF"
+       echo "\$GERRIT_BRANCH: $GERRIT_BRANCH"
        exit 1
 fi
 
@@ -36,16 +42,17 @@
        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"
+DEST_DIR="/srv/org/wikimedia/doc/$TARGET_PROJECTDIR/$TARGET_VERSIONDIR/php"
 [ ! -d "${DEST_DIR}" ] && mkdir -p "${DEST_DIR}"
 
+echo "Found target: '$DEST_DIR'"
+
 # Run the MediaWiki documentation wrapper
 #
 # We want to make sure both stdin and stderr are logged to publicly accessible

-- 
To view, visit https://gerrit.wikimedia.org/r/53947
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie509fcf9a616ce3394476578df28fee57d419cdc
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Krinkle <ttij...@wikimedia.org>
Gerrit-Reviewer: Krinkle <ttij...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to