Skip to content

Commit

Permalink
misc: project files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Rooth committed Jul 24, 2014
1 parent 355fcc0 commit c88a212
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .agignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
frontend/node_modules
frontend/public/img
frontend/public/lib
27 changes: 4 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
/bin
/Godeps/_workspace/github.com/coreos-inc/bridge
/frontend/public/bower_components
/frontend/public/dist
5 changes: 0 additions & 5 deletions NOTICE

This file was deleted.

33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
bridge
======

control center for clusters and fleets


## Standard Build
1. Build the backend `./build`
1. Build the frontend `./build-web`

Backend binaries are generated in `/bin`.
Frontend build assets are generated in `/frontend/public/dist`.

### Dependencies
- go
- nodejs (for frontend builds)


## Hacking

Add new frontend dependencies:
- from `frontend` run `gulp deps`

Add new backend dependencies:
- run `godep save -r ./...`

If changes are made to the `schema/v1.json` file you must:
1. Rebuild the bindings by running: `schema/generator`
1. Rewrite go dependencies: `godep save -r ./...`

Update existing backend dependencies:
1. `go get -u foo/bar` as usual
1. `godep update foo/bar`

### Dependencies
- nodejs glup
14 changes: 14 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

PROJECT_DIR=$(basename $PWD)
export GOPATH=${PWD}/Godeps/_workspace
export GOBIN=${PWD}/bin

if [ ! -h $GOPATH/src/github.com/coreos-inc/$PROJECT_DIR ]; then
mkdir -p $GOPATH/src/github.com/coreos-inc/
ln -s ${PWD} $GOPATH/src/github.com/coreos-inc/$PROJECT_DIR
fi

eval $(go env)

go install github.com/coreos-inc/$PROJECT_DIR/server
4 changes: 4 additions & 0 deletions build-web
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -e

# build frontend
cd frontend && ./node_modules/.bin/gulp
50 changes: 50 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash -e
#
# Run all tests (not including functional)
# ./test
# ./test -v
#
# Run tests for one package
# PKG=./unit ./test
# PKG=ssh ./test
#

# Invoke ./cover for HTML output
COVER=${COVER:-"-cover"}

source ./build

TESTABLE="api server"
FORMATTABLE="$TESTABLE version"

# user has not provided PKG override
if [ -z "$PKG" ]; then
TEST=$TESTABLE
FMT=$FORMATTABLE

# user has provided PKG override
else
# strip out slashes and dots from PKG=./foo/
TEST=${PKG//\//}
TEST=${TEST//./}

# only run gofmt on packages provided by user
FMT="$TEST"
fi

# split TEST into an array and prepend repo path to each local package
split=(${TEST// / })
TEST=${split[@]/#/github.com/coreos-inc/bridge/}

echo "Running tests..."
go test -i ${TEST}
go test ${COVER} $@ ${TEST}

echo "Checking gofmt..."
fmtRes=$(gofmt -l $FMT)
if [ -n "${fmtRes}" ]; then
echo -e "gofmt checking failed:\n${fmtRes}"
exit 255
fi

echo "Success"
Empty file added test-web
Empty file.

0 comments on commit c88a212

Please sign in to comment.