Skip to content

Commit e11179d

Browse files
committed
Add getting started instructions to readme
1 parent 7adb22f commit e11179d

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# make-webhooks
22

3-
> Just try it: `make web`. ;)
3+
> Just try it!
4+
5+
```sh
6+
make web # ;)
7+
```
48

59
You are now exposing this projects `Makefile` to the web!
610

@@ -9,7 +13,7 @@ $ curl http://localhost/hello-world
913
{"status":0}
1014
```
1115

12-
Change environment variables. All vars are uppercased by default.
16+
You can set environment variables, all vars are uppercased by default.
1317
Dont forget HTTP URL encoding!
1418

1519
```sh
@@ -18,6 +22,37 @@ curl "http://localhost/hello-world?GREET=Anthony"
1822
curl "http://localhost/hello-world?greet=Anthony"
1923
```
2024

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+
2156
You can use the webhooks return status as an exit code in another script.
2257

2358
```sh
@@ -71,8 +106,8 @@ Can even do key rotations!
71106

72107
```sh
73108
$ 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
75110
Unauthorized
76-
$ curl -H 'Authorization: Bearer myNewSecret' http://localhost/hello-world ; echo ''
111+
$ curl -H 'Authorization: Bearer myNewSecret' http://localhost/hello-world
77112
{"status":0}
78113
```

docs/welcome.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ You are now exposing this projects `Makefile` to the web!
33

44
> $ curl http://localhost/hello-world
55
> {"status":0}
6+

0 commit comments

Comments
 (0)