mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Build example app in container.
This commit is contained in:
1
Makefile
1
Makefile
@@ -125,6 +125,7 @@ clean:
|
||||
|
||||
deps:
|
||||
go get -u -f -tags netgo \
|
||||
github.com/FiloSottile/gvt \
|
||||
github.com/mattn/goveralls \
|
||||
github.com/mjibson/esc \
|
||||
github.com/weaveworks/github-release
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
CC=gcc
|
||||
CFLAGS=-g -lpthread
|
||||
BUILD_IN_CONTAINER=true
|
||||
|
||||
all: qotd.marker app.marker client.marker searchapp.marker shout.marker frontend.marker echo.marker
|
||||
|
||||
searchapp/searchapp: searchapp/app.go
|
||||
shout/shout: shout/shout.go
|
||||
qotd/qotd: qotd/qotd.o
|
||||
|
||||
ifeq ($(BUILD_IN_CONTAINER),true)
|
||||
qotd/qotd qotd/qotd.o searchapp/searchapp shout/shout:
|
||||
$(SUDO) docker run -ti --rm -v $(shell pwd)/../../:/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \
|
||||
weaveworks/scope-backend-build -C experimental/example $@
|
||||
else
|
||||
qotd/qotd:
|
||||
gcc -o $@ $< $(CFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
searchapp/searchapp: searchapp/app.go
|
||||
shout/shout: shout/shout.go
|
||||
shout/shout searchapp/searchapp:
|
||||
go get -tags netgo ./$(@D)
|
||||
go build -ldflags "-extldflags \"-static\"" -tags netgo -o $@ ./$(@D)
|
||||
endif
|
||||
|
||||
qotd.marker: qotd/* qotd/qotd
|
||||
app.marker: app/*
|
||||
|
||||
1
experimental/example/vendor/github.com/richo/GOSHOUT/README.MD
generated
vendored
Normal file
1
experimental/example/vendor/github.com/richo/GOSHOUT/README.MD
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
GOLANG LIBRARY TO PROD [SHOUTCLOUD](SHOUTCLOUD.IO)
|
||||
46
experimental/example/vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
Normal file
46
experimental/example/vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
package SHOUTCLOUD
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type SHOUTREQUEST struct {
|
||||
INPUT string
|
||||
}
|
||||
|
||||
type SHOUTRESPONSE struct {
|
||||
INPUT string
|
||||
OUTPUT string
|
||||
}
|
||||
|
||||
func UPCASE(THING_TO_YELL string) (string, error) {
|
||||
REQUEST := &SHOUTREQUEST{THING_TO_YELL}
|
||||
ENCODED, ERR := json.Marshal(REQUEST)
|
||||
if ERR != nil {
|
||||
return "", errors.New("COULDN'T MARSHALL THE REQUEST")
|
||||
}
|
||||
READER := bytes.NewReader(ENCODED)
|
||||
|
||||
// NO TLS, SO MUCH SADNESS.
|
||||
RESP, ERR := http.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
|
||||
"application/json", READER)
|
||||
if ERR != nil {
|
||||
return "", errors.New("REQUEST FAILED CAN'T UPCASE ERROR MESSAGE HALP")
|
||||
}
|
||||
|
||||
BODYBYTES, ERR := ioutil.ReadAll(RESP.Body)
|
||||
if ERR != nil {
|
||||
return "", errors.New("COULDN'T READ BODY HALP")
|
||||
}
|
||||
|
||||
var BODY SHOUTRESPONSE
|
||||
if json.Unmarshal(BODYBYTES, &BODY) != nil {
|
||||
return "", errors.New("COULDN'T UNPACK RESPONSE")
|
||||
}
|
||||
|
||||
return BODY.OUTPUT, nil
|
||||
}
|
||||
11
experimental/example/vendor/manifest
vendored
Normal file
11
experimental/example/vendor/manifest
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": 0,
|
||||
"dependencies": [
|
||||
{
|
||||
"importpath": "github.com/richo/GOSHOUT",
|
||||
"repository": "https://github.com/richo/GOSHOUT",
|
||||
"revision": "da80b9993cbabeba5d04ee1c31688313dd730ad8",
|
||||
"branch": "master"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user