make build fail when need to run gofmt & remove docker pull in travis

use golang 1.8.3 for gateway

Signed-off-by: Minh-Quan TRAN <account@itscaro.me>
This commit is contained in:
Minh-Quan TRAN 2017-10-05 15:36:15 +02:00 committed by Alex Ellis
parent 38e0a9956f
commit 1b9affabb4
3 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,6 @@ addons:
- docker-ce - docker-ce
before_install: before_install:
- docker pull golang:1.7.5
script: script:
- sh build.sh - sh build.sh

View File

@ -1,4 +1,4 @@
FROM golang:1.7.5 as build FROM golang:1.8.3 as build
WORKDIR /go/src/github.com/openfaas/faas/gateway WORKDIR /go/src/github.com/openfaas/faas/gateway
COPY vendor vendor COPY vendor vendor

View File

@ -11,9 +11,9 @@ COPY requesthandler_test.go .
COPY types types COPY types types
# Run a gofmt and exclude all vendored code. # Run a gofmt and exclude all vendored code.
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))"
RUN go test RUN go test -v ./...
# Stripping via -ldflags "-s -w" # Stripping via -ldflags "-s -w"
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog . \ RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog . \