Skip to content

Instantly share code, notes, and snippets.

@Jimmy-Xu
Last active November 20, 2017 10:01
Show Gist options
  • Save Jimmy-Xu/1b4da7d02785828ca6cce20874f0f166 to your computer and use it in GitHub Desktop.
Save Jimmy-Xu/1b4da7d02785828ca6cce20874f0f166 to your computer and use it in GitHub Desktop.
build fnproject/fn and fnproject/cli

build fnproject/cli(command client)

准备:
mkdir -p $GOPATH/src/github.com/fnproject
cd $GOPATH/src/github.com/fnproject
git clone https://github.com/fnproject/cli.git
cd cli

for p in yaml mgo
do
  glide mirror set "https://gopkg.in/${p}.v2" "https://github.com/go-${p}/${p}" --vcs git
done

for p in net sys text crypto
do
  glide mirror set "https://golang.org/x/$p" "https://github.com/golang/$p" --vcs git
done

glide install -v

编译:
make
go build -o fn main.go

运行:
./fn 

build fnproject/fn(server)

准备:
mkdir -p $GOPATH/src/github.com/fnproject
cd $GOPATH/src/github.com/fnproject
git clone https://github.com/fnproject/fn.git
cd fn

glide mirror set https://google.golang.org/genproto https://github.com/google/go-genproto --vcs git
glide mirror set https://google.golang.org/grpc https://github.com/grpc/grpc-go --vcs git
glide mirror set https://gopkg.in/go-playground/validator.v8 https://github.com/go-playground/validator --vcs git

编译:
make
go build -o functions main.go

运行:
./functions


debug模式:
LOG_LEVEL=DEBUG ./functions

add profiling code

for fnproject/fn
https://github.com/Jimmy-Xu/fn/commit/30107631fb42f4d5ef42595c3963116636d225ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment