Merge branch 'master' into 8-healthz-endpoint

This commit is contained in:
Mikolaj Pawlikowski
2018-12-21 18:59:29 +01:00
committed by GitHub
5 changed files with 27 additions and 10 deletions
+2
View File
@@ -0,0 +1,2 @@
.git/
/vendor/
+13 -2
View File
@@ -9,7 +9,18 @@ go:
script:
- docker --version
- go get -u github.com/golang/dep/cmd/dep && make vendor && make && make build
# dep
- go get -u github.com/golang/dep/cmd/dep
# build locally and run locally
- make clean && make vendor && make && ./bin/goldpinger --help
# build an image and run the image
- make clean && make vendor && make build
- docker images
- make build-multistage
- docker run `make version` --help
# build an image using the multistage builder
- make clean && make build-multistage
- docker images
- docker run `make version` --help
+3 -5
View File
@@ -5,17 +5,15 @@ FROM golang:1.11-alpine as builder
RUN apk add --update git make bash
RUN go get -u github.com/golang/dep/cmd/dep
# Get sources
# Get dependencies
RUN go get github.com/bloomberg/goldpinger/cmd/goldpinger
WORKDIR /go/src/github.com/bloomberg/goldpinger
# Install our dependencies
COPY Gopkg.toml Gopkg.lock Makefile ./
RUN make vendor
# Build goldpinger
COPY . ./
RUN make bin/goldpinger
# Build the asset container, copy over goldpinger
+8 -3
View File
@@ -3,12 +3,13 @@ version ?= 1.1.0
bin ?= goldpinger
pkg ?= "github.com/bloomberg/goldpinger"
tag = $(name):$(version)
goos ?= ${GOOS}
namespace ?= ""
files = $(shell find . -iname "*.go")
bin/$(bin): $(files)
PKG=${pkg} ARCH=amd64 VERSION=${version} BIN=${bin} ./build/build.sh
GOOS=${goos} PKG=${pkg} ARCH=amd64 VERSION=${version} BIN=${bin} ./build/build.sh
clean:
rm -rf ./vendor
@@ -16,7 +17,7 @@ clean:
vendor:
rm -rf ./vendor
dep ensure -v
dep ensure -v -vendor-only
swagger:
swagger generate server -t pkg -f ./swagger.yml --exclude-main -A goldpinger && \
@@ -25,6 +26,7 @@ swagger:
build-multistage:
docker build -t $(tag) -f ./Dockerfile .
build: GOOS=linux
build: bin/$(bin)
docker build -t $(tag) -f ./build/Dockerfile-simple .
@@ -36,5 +38,8 @@ push:
run:
go run ./cmd/goldpinger/main.go
version:
@echo $(tag)
.PHONY: clean vendor build-swagger build tag push run
.PHONY: clean vendor swagger build build-multistage tag push run version
+1
View File
@@ -35,6 +35,7 @@ fi
export CGO_ENABLED=0
export GOARCH="${ARCH}"
export GOOS=${GOOS:-}
go build \
-ldflags "-X 'main.Version=${VERSION}' -X 'main.Build=`date`'" \