~evhan/chicken-sourcehut

ref: 60c9a2d2d4e282eb37c637d21b9c625283083734 chicken-sourcehut/README.md -rw-r--r-- 1.4 KiB
60c9a2d2Evan Hanson Add missing space to command in README 3 years ago

#Topham

CHICKEN Scheme client for sr.ht.

#Resources

#Installation

chicken-install topham

#Examples

#Using the Extension Library

Create a new job on builds.sr.ht and fetch information about it:

(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.

$ 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.