Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/173049

Change subject: Zuul function to set DOC_PATH prefix (WIP)
......................................................................

Zuul function to set DOC_PATH prefix (WIP)

Need tests :)

Change-Id: I5fbb100294597cbdf029c285fe53b1285a9532c2
---
A zuul/docfunctions.py
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/49/173049/1

diff --git a/zuul/docfunctions.py b/zuul/docfunctions.py
new file mode 100644
index 0000000..e66991d
--- /dev/null
+++ b/zuul/docfunctions.py
@@ -0,0 +1,23 @@
+import re
+
+tag_re = r'^refs/tags/(.*)'
+
+
+def set_doc_suffix(item, job, params):
+    change = item.change
+    docsuffix = ''
+
+    # ref-updated
+    # Tags: 'refs/tags/foo'
+    # Branch: 'master'
+    if hasattr(change, 'ref'):
+        tag = re.match(tag_re, change.ref)
+        if tag:
+            docsuffix = tag.group(1)
+        else:
+            docsuffix = change.ref
+    # Changes
+    elif hasattr(change, 'refspec'):
+        docsuffix = change.branch
+
+    params['DOC_SUFFIX'] = docsuffix

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fbb100294597cbdf029c285fe53b1285a9532c2
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to