jenkins-bot has submitted this change and it was merged.

Change subject: mw-core-get.sh: snapshot a mediawiki/core treeish
......................................................................


mw-core-get.sh: snapshot a mediawiki/core treeish

On labs we do not have a local replication of mediawiki/core, instead
fallback to git.wikimedia.org.

Change-Id: I37ff7884df542aba23d1db57dbcdb12362e9b180
---
A bin/mw-core-get.sh
1 file changed, 25 insertions(+), 0 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/mw-core-get.sh b/bin/mw-core-get.sh
new file mode 100755
index 0000000..32612f4
--- /dev/null
+++ b/bin/mw-core-get.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -x
+
+# Local bare git repository
+# On Wikimedia CI server, that is a Gerrit replica
+GIT_LOCAL="/srv/ssd/gerrit/mediawiki/core.git"
+
+# git tree-ish passed to git-archve (or gitblit)
+TREE_ISH=${1:-'master'}
+
+# Very basic validation
+if [[ ! -d "$WORKSPACE" || ! -w "$WORKSPACE" ]]; then
+       echo "\$WORKSPACE must be pointing to a directory"
+       exit 1
+fi
+
+function tar_extract() {
+       (cd "$WORKSPACE" && tar xzf -)
+}
+
+if [ -d "$GIT_LOCAL"]; then
+       git archive --remote="$GIT_LOCAL" "$TREE_ISH" | tar_extract
+else
+       # Fallback to git.wikimedia.org
+       curl 
"https://git.wikimedia.org/zip/?r=mediawiki/core.git&format=gz&h=$TREE_ISH"; | 
tar_extract
+fi

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I37ff7884df542aba23d1db57dbcdb12362e9b180
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to