MCPcopy Create free account
hub / github.com/danderson/netboot / main

Function main

scripts/trigger_docker_build/main.go:30–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30func main() {
31 url := os.Getenv("DOCKER_TRIGGER_URL")
32 if url == "" {
33 fatalf("no DOCKER_TRIGGER_URL found in environment")
34 }
35
36 resp, err := http.Post(url, "application/json", bytes.NewBufferString(`{"docker_tag": "latest"}`))
37 if err != nil {
38 fatalf("post to docker trigger: %s", err)
39 }
40 if resp.StatusCode != 200 {
41 msg, err := ioutil.ReadAll(resp.Body)
42 if err != nil {
43 fatalf("reading error message from docker trigger response: %s", err)
44 }
45 fatalf("non-200 status from docker trigger: %s (%q)", resp.Status, string(msg))
46 }
47
48 fmt.Printf("Triggered Docker build\n")
49}

Callers

nothing calls this directly

Calls 1

fatalfFunction · 0.70

Tested by

no test coverage detected