summaryrefslogtreecommitdiff
path: root/herculeswrapper/herc-map-wrapper-config.example
blob: b3afd8db74478a9777838c552043c5b3aae77a06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
## 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
evol_music=../music
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/|;')
)

music_main_branch=origin/master

music_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