From 999820d15b1600c3485f61e862e97a26efafe279 Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Wed, 9 May 2018 00:52:52 -0700 Subject: [PATCH] Moves main into cmd dir. (#977) --- Dockerfile | 2 +- Makefile | 4 ++-- build.ps1 | 2 +- main.go => cmd/fnserver/main.go | 0 examples/extensions/README.md | 2 +- images/api/Dockerfile | 2 +- images/lb/Dockerfile | 2 +- images/runner/Dockerfile | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename main.go => cmd/fnserver/main.go (100%) diff --git a/Dockerfile b/Dockerfile index 99c37b66e..dde955282 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.10-alpine AS build-env RUN apk --no-cache add build-base git bzr mercurial gcc ENV D=/go/src/github.com/fnproject/fn ADD . $D -RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/ +RUN cd $D/cmd/fnserver && go build -o fn-alpine && cp fn-alpine /tmp/ # final stage: the local fnproject/dind:latest will be either built afresh or # whatever is the latest from master, depending on whether we're releasing diff --git a/Makefile b/Makefile index 08409886b..08930f346 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ dep-up: dep ensure build: api/agent/grpc/runner.pb.go - go build -o fnserver + go build -o fnserver ./cmd/fnserver install: - go build -o ${GOPATH}/bin/fnserver + go build -o ${GOPATH}/bin/fnserver ./cmd/fnserver checkfmt: ./go-fmt.sh diff --git a/build.ps1 b/build.ps1 index e9733f125..526eb2e8a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -21,7 +21,7 @@ function quick() { } function build () { - docker run --rm -v ${pwd}:/go/src/github.com/fnproject/fn -w /go/src/github.com/fnproject/fn golang:alpine go build -o fn-alpine + docker run --rm -v ${pwd}:/go/src/github.com/fnproject/fn -w /go/src/github.com/fnproject/fn/cmd/fnserver golang:alpine go build -o fn-alpine docker build -t fnproject/fnserver:latest . function run () { diff --git a/main.go b/cmd/fnserver/main.go similarity index 100% rename from main.go rename to cmd/fnserver/main.go diff --git a/examples/extensions/README.md b/examples/extensions/README.md index a982553f8..8d3ef2773 100644 --- a/examples/extensions/README.md +++ b/examples/extensions/README.md @@ -1,6 +1,6 @@ # Extensions Example -This example adds extra endpoints to the API. See [main.go](main.go) for example code. +This example adds extra endpoints to the API. See [main.go](main.go) for example code. ## Building and Running diff --git a/images/api/Dockerfile b/images/api/Dockerfile index b3d3f0078..468bd1099 100644 --- a/images/api/Dockerfile +++ b/images/api/Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.10-alpine AS build-env RUN apk --no-cache add build-base git bzr mercurial gcc ENV D=/go/src/github.com/fnproject/fn ADD . $D -RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/ +RUN cd $D/cmd/fnserver && go build -o fn-alpine && cp fn-alpine /tmp/ # final stage: the local fnproject/dind:latest will be either built afresh or # whatever is the latest from master, depending on whether we're releasing diff --git a/images/lb/Dockerfile b/images/lb/Dockerfile index 57ddca87e..5d8b3bf81 100644 --- a/images/lb/Dockerfile +++ b/images/lb/Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.10-alpine AS build-env RUN apk --no-cache add build-base git bzr mercurial gcc ENV D=/go/src/github.com/fnproject/fn ADD . $D -RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/ +RUN cd $D/cmd/fnserver && go build -o fn-alpine && cp fn-alpine /tmp/ # final stage: the local fnproject/dind:latest will be either built afresh or # whatever is the latest from master, depending on whether we're releasing diff --git a/images/runner/Dockerfile b/images/runner/Dockerfile index 6d512e4d8..951382723 100644 --- a/images/runner/Dockerfile +++ b/images/runner/Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.10-alpine AS build-env RUN apk --no-cache add build-base git bzr mercurial gcc ENV D=/go/src/github.com/fnproject/fn ADD . $D -RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/ +RUN cd $D/cmd/fnserver && go build -o fn-alpine && cp fn-alpine /tmp/ # final stage: the local fnproject/dind:latest will be either built afresh or # whatever is the latest from master, depending on whether we're releasing