-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
327 lines (295 loc) · 15.2 KB
/
index.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Deepl.io</title>
<meta name="description" content="A simple yet powerful PHP tool to catch Git web hooks from GitLab, GitHub & Bitbucket and deploy your projects to your server after pushing." />
<link rel="shortcut icon" href="assets/img/icon/favicon.png" type="image/x-icon" />
<link rel="apple-touch-icon" href="assets/img/icon/apple-touch-icon.png" />
<meta name="application-name" content="Deepl.io" />
<meta name="msapplication-TileColor" content="#5133ab" />
<meta name="msapplication-TileImage" content="assets/img/icon/tile-icon.png" />
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css" media="screen">
h1 {
color: #555;
}
body {
color: #666;
}
a {
color: #679C6A;
}
a:hover {
color: #79D195;
}
.btn-success {
background: #79D195;
}
.btn-success:hover {
background: #679C6A;
}
.btn-info {
background: #E90089;
}
.btn-info:hover {
background: #9A2160;
}
.btn,
.btn:hover {
border-color: #eee;
}
.logo {
margin-left: -20px;
}
.navbar-header {
line-height: 48px;
}
.logo-footer {
margin: 6em 0 2em;
}
.copy {
color: #999;
font-size: 0.9em;
}
.copy a {
color: #777;
}
</style>
</head>
<body>
<header class="navbar navbar-default" role="banner">
<div class="container">
<div class="navbar-header">
Git deployment simplified.
</div>
<nav class="collapse navbar-collapse" role="navigation">
<!--<ul class="nav navbar-nav">
<li>
<a href="/admin/">Overview</a>
</li>
</ul>-->
</nav>
</div>
</header>
<div class="container">
<h1><a href="http://deepl.io"><span class="sr-only">Deepl.io</span>
<img class="logo" src="/assets/img/[email protected]" height="120px" alt="Deepl.io">
</a>
</h1>
<div class="row">
<div class="col-md-7">
<p class="lead ">A simple yet powerful PHP tool to catch Git webhooks from GitLab, GitHub & Bitbucket and deploy your projects to your server after pushing.</p>
<p>
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=noelboss&repo=Deepl.io&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=noelboss&repo=Deepl.io&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="102px" height="20px"></iframe>
<a href="https://twitter.com/intent/tweet?button_hashtag=Deepl.io&text=I%20use%20Deepl.io%20do%20easily%20deploy%20my%Git%20projects%20using%20web-hooks.%20Try%20it,%20it's%20great!%20http://deepl.io/%20%20#Deepl.io" class="twitter-share-button" data-url="http://deepl.io"
data-text="I use Deepl.io do easily deploy my Git projects using webhooks. Try it, it's great!" data-hashtags="Deepl.io" data-dnt="true">Tweet</a>
<script>
! function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');
</script>
</p>
</div>
<div class="col-md-5">
<p class="text-right">
<a href="https://github.com/noelboss/deepl.io" class="btn btn-info" name="deploy<?= $i ?>">Visit GitHub</a>
<a href="https://github.com/noelboss/deepl.io/archive/master.zip" class="btn btn-success" name="deploy<?= $i ?>">Download Latest (0.11.1)</a>
</p>
</div>
<div class="col-md-12">
<hr/>
<h2>Features</h2>
<ul>
<li>Catch webhooks from <a href="http://gitlab.com">GitLab</a>, <a href="http://github.com">GitHub</a> & <a href="http://bitbucket.org">Bitbucket</a></li>
<li>Configure multiple repositories</li>
<li>Configure multiple branches per repository</li>
<li>Use your own deploy scripts, either PHP, shell or both</li>
<li>Sends confirmation emails</li>
</ul>
</div>
<p class="col-md-12">
<hr/>
<h2>How does it work?</h2>
<p>
Deepl.io catches and then acts on post requests sent by your git service-provider using <a href="https://developer.github.com/v3/repos/hooks/">webhooks</a>. Currently <a href="http://doc.gitlab.com/ee/web_hooks/web_hooks.html">github.com</a>,
<a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md">gitlab.com</a> and <a href="https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html">bitbucket.org</a> are supported.<br/> You
configure your repository to send push-updates to your Deepl.io instance running on your server via Webhooks. Check the repository setting for the appropriate options. Deepl.io will check if the request comes from the right source,
detects if the branch that has been updated is correct and then executes your custom PHP or shell commands. Deepl.io only calls your commands, it does not act on it's own since this would be way too inflexible.
</p>
<hr/>
<h2>Installation</h2>
<p>
<a href="https://github.com/noelboss/deepl.io/archive/master.zip">Download</a> Deepl.io to your server or <a href="https://github.com/noelboss/deepl.io">clone using Git</a>. Consider creating a subdomain:
<code>deploy.yourserver.com</code>.
</p>
<p>
<strong>Requirements:</strong> PHP, and your web host needs to allow <a href="http://php.net/manual/en/function.exec.php">php exec</a> commands and <code>mod_rewrite</code> has to be enabled.
</p>
<hr/>
<h2>Setup Depl.io</h2>
<p>
Open <code><a href="https://github.com/noelboss/deepl.io/blob/master/config/config.example.json">config/config.example.json</a></code> and rename it to <code>config.json</code>. Set a secret token and maybe configure allowed IPs.
<br/> You can configure the repositoryPath to a location outside the deepl.io path to use your own git repo for the deploy-configuration:
<code>"repositoriesPath": "./../my-own-deployment-repositories/"</code>
<br/> Then, add this to the webhook settings of your Git provider:
<code>deploy.yourserver.com/your-secret-token</code>
</p>
<hr/>
<h2>Configure Deployments</h2>
<p>
Right now, you need to configure your deploys manually. It's pretty simple: Open the <code>repositories/</code> folder, create a new folder corresponding with your Git repository name and add 3 files:<br />
</p>
<div class="list-group">
<a href="https://github.com/noelboss/deepl.io/blob/master/repositories/example.git/deploy-test.config.json" class="list-group-item">
<h4 class="list-group-item-heading"><code>your-repo.git</code>/<code>branch.config.json</code></h4>
<p class="list-group-item-text">containing information (name, repository_ssh_url, branch) required to identify your deployment.</p>
</a>
<a href="https://github.com/noelboss/deepl.io/blob/master/repositories/example.git/deploy-test.script.sh" class="list-group-item">
<h4 class="list-group-item-heading"><code>your-repo.git</code>/<code>branch.script.php / .sh</code></h4>
<p class="list-group-item-text">contains the code that should be executed when the hook is called. PHP scripts take precedence over shell scripts since they can call themselves.</p>
</a>
<a href="https://github.com/noelboss/deepl.io/blob/master/repositories/example.git/deploy-test.request.json" class="list-group-item">
<h4 class="list-group-item-heading"><code>your-repo.git</code>/<code>branch.request.json</code></h4>
<p class="list-group-item-text">(optional) containing a test JSON payload.</p>
</a>
</div>
<p>The <code>branch.</code> part is needed to distinguish push events only for the desired branch.</p>
<p>
<strong>Example Structure:</strong><br/>
<code>deepl.io.git</code>/<code>master.config.json</code><br/>
<code>deepl.io.git</code>/<code>master.script.sh</code><br />
<code>deepl.io.git</code>/<code>master.request.json</code><br />
</p>
<hr/>
<h4>Example Project Configuration</h4>
<p>Make sure to set the "enabled" flag to enable execution</p>
<pre>
{
"enabled": true,
"project": {
"name": "Example Music Project",
"repository_ssh_url": "[email protected]:music/example.git",
"branch": "deploy/test"
},
"mails": {
"[email protected]": "Michael Jackson",
"[email protected]": "Tina Turner"
}
}
</pre>
<p>
It is important, that the "repository_ssh_url" matches the repository that your service provider delivers using the JSON payload. You can test this by calling <a href="/admin/">/admin/</a> (protected by .htaccess, only works localy)
and updating the example request <code>branch.request.json</code>:
</p>
<strong><a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md">GitLab JSON</a>:</strong><pre>
"repository": {
"git_ssh_url":"[email protected]:music/example.git",
},
</pre>
<strong><a href="http://doc.gitlab.com/ee/web_hooks/web_hooks.html">GitHub JSON</a>:</strong><pre>
"repository": {
"ssh_url": "[email protected]:music/example.git",
},
</pre>
<strong><a href="https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html#EventPayloads-Push">Bitbucket JSON</a>:</strong>
<p>Create <code>repository_ssh_url</code> using the full repository name found in the json:</p>
<pre>
"repository": {
"full_name": "music/example",
},
</pre>
<p><code>[email protected]:</code> + <code>{full_name}</code> + <code>.git</code> converts to <code>[email protected]:music/example.git</code></p>
<hr/>
<h2>Debugging & Issues</h2>
<p>
Check <code>logs/deeplio.log</code> if you have any problems or open up an <a href="https://github.com/noelboss/deepl.io/issues">issue</a>.
</p>
<div class="check hidden">
<hr/>
<h2>System Check</h2>
<p class="hidden check-htaccess alert">.htaccess & mod_rewrite: <strong>checking...</strong></p>
<p class="hidden check-config alert">config.json: <strong>checking...</strong></p>
</div>
</div>
</div>
<footer>
<p class="text-center logo-footer">
<a href="http://deepl.io">
<img src="/assets/img/[email protected]" height="25" alt="Deeplio Logo">
</a>
</p>
<p class="text-right">
<small class="copy">© <a href="//noelboss.com">Noël Bossart</a>. Made in Switzerland.</small>
</p>
</footer>
</div>
<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="//cdn.rawgit.com/noelboss/featherlight/1.3.2/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
if ('https://deepl.io/' !== window.location.href) {
$(document).ajaxComplete(function() {
$('.check').removeClass('hidden');
});
(function() {
var $t = $(".check-htaccess");
$.ajax("app/deeplio/test.php")
.done(function(data) {
$t.addClass('alert-success');
$("strong", $t).text(data);
})
.fail(function() {
$("strong", $t.addClass('alert-danger')).text('not working!');
})
.always(function() {
$t.removeClass('hidden');
});
})();
(function() {
$t = $(".check-config");
$.ajax({
url: "app/deeplio/test.php",
data: {
'config': 1
}
})
.done(function(data) {
$t.addClass('alert-success');
$("strong", $t).text(data);
})
.fail(function(data) {
$("strong", $t.addClass('alert-danger')).text(data.responseText);
})
.always(function() {
$t.removeClass('hidden');
});
})();
}
});
</script>
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-5342062-8', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>