-
Notifications
You must be signed in to change notification settings - Fork 0
/
test004-notify-webhook.html
162 lines (127 loc) · 3.53 KB
/
test004-notify-webhook.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="test.css">
<title>Test 004</title>
</head>
<body>
<header>
<div class="content">
<h1><a class="homelink" href="/">Postsai</a></h1>
<h2>The Commit Database</h2>
<a class="button" href="https://github.com/postsai/postsai">GitHub</a>
<a class="button" href="https://arianne-project.org/postsai/query.html?date=month">Demo</a>
<a class="button download" href="https://github.com/postsai/postsai/releases/download/v0.9.7/postsai-0.9.7.zip">Download</a>
</div>
</header>
<div class="content">
<section>
<table class="table table-bordered">
<tr class="th">
<th colspan="2"><h3>Test 004: notify-webhook</h3></th>
</tr>
<tr>
<th>Objective</th>
<td>Ensure it is possible to invoke webhooks from custom Git repositories.</td>
</tr>
<tr>
<th>Test Status</th>
<td>Stable</td>
</tr>
<tr>
<th>Prerequisite</th>
<td>A Postsai installation on a Debian/Ubuntu system and the Git command line tool.</td>
</tr>
</table>
</section>
<section>
<table class="table table-striped table-bordered table-hover">
<tr class="th">
<th>#</th>
<th>Action</th>
<th>User input</th>
<th>Expected result</th>
</tr>
<tr>
<td>1</td>
<td>Create test workspace and change into it</td>
<td><code>mkdir /tmp/postsaitest; cd /tmp/postsaitest</code></td>
<td>No error messages and the current working directory was changed.</td>
</tr>
<tr>
<td>2</td>
<td>Create a new Git server repository</td>
<td><code>git init --bare gitserver</code></td>
<td>Empty repository is initialized in /tmp/postsaitest/gitserver</td>
</tr>
<tr>
<td>3</td>
<td>Change working directory </td>
<td><code>cd gitserver</code></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>Configure webhook</td>
<td><code>git config meta.url "http://example.com"; <br>git config hooks.webhookurl "http://localhost/postsai/api.py"; <br>git config hooks.webhook-contenttype application/json
</code></td>
<td>File was saved</td>
</tr>
<tr>
<td>5</td>
<td>Download notify-webhook </td>
<td><code>wget -O hooks/post-receive https://raw.githubusercontent.com/nhnb/notify-webhook/master/notify-webhook.py</code></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>Make it executable</td>
<td><code>chmod +x hooks/post-receive</code></td>
<td></td>
</tr>
<tr>
<td>7</td>
<td>Change working directory </td>
<td><code>cd /tmp/postsaitest</code></td>
<td>Working directory changed</td>
</tr>
<tr>
<td>8</td>
<td>Checkout local repository</td>
<td><code>git clone gitserver gitclient</code></td>
<td>Warning about empty repository</td>
</tr>
<tr>
<td>9</td>
<td>Change into client working directory</td>
<td><code>cd gitclient</code></td>
<td>Working directory changed</td>
</tr>
<tr>
<td>10</td>
<td>Make a test push</td>
<td><code>echo a > test; git add test; git commit -m "test message" test; git push</code></td>
<td>There may be an error message because it is the very first commit.</td>
</tr>
<tr>
<td>11</td>
<td>Make a test push</td>
<td><code>echo a >> test; git commit -m "test message" test; git push</code></td>
<td>No error message</td>
</tr>
<tr>
<td>12</td>
<td>Verify commit entry in postsai</td>
<td>Open http://localhost/postsai/ in a web browser.</td>
<td>The commit of test is listed. The File-column has a link which starts with http://example.com/?p=gitserver;a=blob;f=test;</td>
</tr>
</table>
</section>
<footer>
(C) Copyright 2016-2017 Postsai. Postsai is released as Free and Open Source Software under MIT license.
</footer>
</div>
</body>
</html>