Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build example app in container. #831

Merged
merged 4 commits into from Jan 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -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
13 changes: 8 additions & 5 deletions circle.yml
Expand Up @@ -17,11 +17,14 @@ dependencies:
cache_directories:
- "~/docker"
override:
- "sudo apt-get update && sudo apt-get install jq pv"
- curl https://sdk.cloud.google.com | bash
- test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD"
- make deps
- "mkdir -p $(dirname $SRCDIR) && cp -r $(pwd)/ $SRCDIR"
- >
sudo apt-get update &&
sudo apt-get install jq pv &&
(curl https://sdk.cloud.google.com | bash) &&
(test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD") &&
make deps &&
mkdir -p $(dirname $SRCDIR) &&
cp -r $(pwd)/ $SRCDIR
- "cd $SRCDIR/client; ../tools/rebuild-image weaveworks/scope-ui-build . Dockerfile package.json webpack.production.config.js .eslintrc .babelrc && touch $SRCDIR/.scope_ui_build.uptodate"
- "cd $SRCDIR/backend; ../tools/rebuild-image weaveworks/scope-backend-build . Dockerfile build.sh && touch $SRCDIR/.scope_backend_build.uptodate"
- cd $SRCDIR/integration; ./gce.sh make_template:
Expand Down
14 changes: 11 additions & 3 deletions experimental/example/Makefile
@@ -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/*
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions experimental/example/vendor/github.com/richo/GOSHOUT/SHOUT.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions experimental/example/vendor/manifest
@@ -0,0 +1,11 @@
{
"version": 0,
"dependencies": [
{
"importpath": "github.com/richo/GOSHOUT",
"repository": "https://github.com/richo/GOSHOUT",
"revision": "da80b9993cbabeba5d04ee1c31688313dd730ad8",
"branch": "master"
}
]
}
2 changes: 1 addition & 1 deletion tools/lint
Expand Up @@ -148,7 +148,7 @@ function lint_files {

function list_files {
if [ $# -gt 0 ]; then
find "$@" -type f | grep -vE '^\./(\.git|vendor)/'
find "$@" -type f | grep -vE '(^\./\.git|^\./\.pkg|/vendor/)'
else
git diff --cached --name-only
fi
Expand Down