ref: 0.1.6 topham/README.md -rw-r--r-- 1.5 KiB View raw
                                                                                
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
# Topham

CHICKEN Scheme client for [sr.ht](https://sr.ht/).

## Resources

 * Sources: <https://git.sr.ht/~evhan/topham>
 * Issues: <https://todo.sr.ht/~evhan/topham>
 * Documentation: <https://api.call-cc.org/5/doc/topham>

## Installation

Use your distribution's package manager to install CHICKEN 5.0 or newer,
then run:

``` shell
chicken-install -s topham
```

On some platforms you may be required to install OpenSSL development
headers first.

## Examples

### Using the Extension Library

Create a new job on [builds.sr.ht](https://builds.sr.ht/) and fetch
information about it:

``` scheme
(import (topham)
        (topham builds))

(access-token "your-access-token-goes-here")

(create (job manifest: "xyz"))
; => ((#:service "builds" #:path "/api/jobs")
;     (id . 1234))

(retrieve (job 1234))
; => ((#:service "builds" #:path "/api/jobs/1234")
;     (id . 1234)
;     (status . "running")
;     (setup_log ...)
;     (tasks . #(...))
;     (runner ...))

(retrieve (manifest 1234))
; => "xyz"
```

### Using the Command Line Interface

As above, but using the `topham` CLI program.

``` bash
$ export SRHT_ACCESS_TOKEN="your-access-token-goes-here"

$ topham create job --manifest build.yaml --note "Example build"
((id . 1234))

$ topham get job 1234
((id . 1234)
 (status . "running")
 (setup_log ...)
 (tasks . #(...))
 (runner ...))

$ topham get job 1234 -o json | jq
{
  "id": 1234,
  "status": "running",
  "setup_log": ...,
  "tasks": [...],
  "note": "Example build",
  "runner": ...
}
```

## License

Three-clause BSD. See LICENSE for details.