summaryrefslogtreecommitdiff
path: root/herculeswrapper/herc-map-wrapper-config.example
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-10-13 22:03:31 +0000
committerAndrei Karas <akaras@inbox.ru>2016-10-13 22:03:31 +0000
commite45dd72f3e372104f75803753dd11b5da60a86d0 (patch)
tree41a9c5437eca0e4f4723b1fe8c0838015f03c57f /herculeswrapper/herc-map-wrapper-config.example
parent994250e7619a0a18a61d65c9a132fcf71abce2f2 (diff)
parentedef2f2479bf22d390e6c91ae81051f53c28a5e0 (diff)
downloadtools-e45dd72f3e372104f75803753dd11b5da60a86d0.tar.gz
tools-e45dd72f3e372104f75803753dd11b5da60a86d0.tar.bz2
tools-e45dd72f3e372104f75803753dd11b5da60a86d0.tar.xz
tools-e45dd72f3e372104f75803753dd11b5da60a86d0.zip
Merge branch 'gitlab-merger' into 'master'
Gitlab Auto-Merge MRs on test See merge request !9
Diffstat (limited to 'herculeswrapper/herc-map-wrapper-config.example')
-rw-r--r--herculeswrapper/herc-map-wrapper-config.example70
1 files changed, 70 insertions, 0 deletions
diff --git a/herculeswrapper/herc-map-wrapper-config.example b/herculeswrapper/herc-map-wrapper-config.example
new file mode 100644
index 0000000..233d072
--- /dev/null
+++ b/herculeswrapper/herc-map-wrapper-config.example
@@ -0,0 +1,70 @@
+## config for herc-map-wrapper
+
+echo "Copy this file to herc-map-wrapper-config" >&2
+echo "Then You need to either set the oauth secret" >&2
+echo "or use a hard-coded list instead of list_issues" >&2
+echo "Both github and gitlab methods are included.">&2
+echo "Make sure to comment out the method that isn't used" >&2
+echo "Update the <repo ids> with the ID number for gitlab" >&2
+echo "or the repo name if github i.e. themanaworld/server-data" >&2
+echo "Then, delete these lines" >&2
+exit 1
+
+server_data=../../server-data
+client_data=../client-data
+tmw_tools=../tools
+
+#gitlab
+list_issues()
+{
+python -c '
+
+# replace this with one of your oauth keys from github (no permissions needed)
+oauth = "01234567890123456789"
+
+import requests
+issues = requests.get("https://gitlab.com/api/v3/projects/%d/merge_requests" % '$1', params={"state": "opened"}, headers={"PRIVATE-TOKEN": "%s" % oauth, "Accept": "application/vnd.gitlab.v3+json"})
+issues.raise_for_status()
+for issue in issues.json():
+ if "test" in issue["labels"]:
+ print(issue["iid"])
+' | sort -n
+}
+
+#github
+list_issues()
+{
+python -c '
+
+# replace this with one of your oauth keys from github (no permissions needed)
+oauth = "0123456789abcdef0123456789abcdef01234567"
+
+import requests
+issues = requests.get("https://api.github.com/search/issues", params={"q": "repo:'$1' type:pr state:open label:test"}, headers={"Authorization": "token %s" % oauth, "Accept": "application/vnd.github.v3+json"})
+issues.raise_for_status()
+for issue in issues.json["items"]:
+ print(issue["number"])
+' | sort -n
+}
+
+
+server_main_branch=origin/master
+
+server_extra_branches=(
+ $(list_issues <repo id> | sed 's|^|origin/merge-requests/|;')
+)
+
+client_main_branch=origin/master
+
+client_extra_branches=(
+ $(list_issues <repo id> | sed 's|^|origin/merge-requests/|;')
+)
+unset list_issues
+
+motd=../server-data/npc/commands/motd-debug-text.txt
+
+expected_life=60
+trouble_sleep=60
+normal_sleep=5
+
+ulimit -c unlimited