1
1
# make-webhooks
2
2
3
- > Just try it: ` make web ` . ;)
3
+ > Just try it!
4
+
5
+ ``` sh
6
+ make web # ;)
7
+ ```
4
8
5
9
You are now exposing this projects ` Makefile ` to the web!
6
10
@@ -9,7 +13,7 @@ $ curl http://localhost/hello-world
9
13
{" status" :0}
10
14
```
11
15
12
- Change environment variables. All vars are uppercased by default.
16
+ You can set environment variables, all vars are uppercased by default.
13
17
Dont forget HTTP URL encoding!
14
18
15
19
``` sh
@@ -18,6 +22,37 @@ curl "http://localhost/hello-world?GREET=Anthony"
18
22
curl " http://localhost/hello-world?greet=Anthony"
19
23
```
20
24
25
+
26
+ ## Getting Started
27
+
28
+ > Shut up and get me running!
29
+
30
+ Mount local directory into docker swarm:
31
+
32
+ ``` sh
33
+ ssh root@server
34
+ docker swarm init
35
+ wget https://raw.githubusercontent.com/expelledboy/make-webhooks/master/Makefile
36
+ make HOSTNAME=webhooks.example.com start-webhooks
37
+ ```
38
+
39
+ > OR
40
+
41
+ Build a docker image with your custom Makefile.
42
+
43
+ ``` dock
44
+ FROM expelledboy/make-webhooks:latest
45
+ RUN apk add --no-cache jq # Makefile deps
46
+ COPY Makefile /webhook/Makefile
47
+ ```
48
+
49
+ ``` sh
50
+ docker build -t my-webhooks .
51
+ docker run -it --rm -p 3000:3000 my-webhooks
52
+ ```
53
+
54
+ ## Guide
55
+
21
56
You can use the webhooks return status as an exit code in another script.
22
57
23
58
``` sh
@@ -71,8 +106,8 @@ Can even do key rotations!
71
106
72
107
```sh
73
108
$ echo -n myNewSecret > SECRET
74
- $ curl -H 'Authorization : Bearer mySecret' http://localhost/hello-world ; echo ''
109
+ $ curl -H 'Authorization : Bearer mySecret' http://localhost/hello-world
75
110
Unauthorized
76
- $ curl -H 'Authorization : Bearer myNewSecret' http://localhost/hello-world ; echo ''
111
+ $ curl -H 'Authorization : Bearer myNewSecret' http://localhost/hello-world
77
112
{"status" :0}
78
113
```
0 commit comments