release tools

This synchronizes the build rules with other repos and (as part of
that) bumps the Go version to 1.11.1. The recommended formatting
changed slightly in that Go version.
This commit is contained in:
Patrick Ohly
2019-01-24 17:30:10 +01:00
parent ef4420bd96
commit 054c612f6b
3 changed files with 5 additions and 45 deletions

View File

@@ -1,13 +0,0 @@
language: go
matrix:
include:
- go: 1.10.3
script:
- go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0
- go vet $(go list ./... | grep -v vendor)
- go test $(go list ./... | grep -v vendor)
after_success:
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;
make push;
fi

1
.travis.yml Symbolic link
View File

@@ -0,0 +1 @@
release-tools/travis.yml

View File

@@ -14,34 +14,6 @@
.PHONY: all csi-snapshotter clean test .PHONY: all csi-snapshotter clean test
REGISTRY_NAME=quay.io/k8scsi CMDS=csi-snapshotter
IMAGE_NAME=csi-snapshotter all: build
IMAGE_VERSION=canary include release-tools/build.make
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
REV=$(shell git describe --long --tags --match='v*' --dirty)
ifdef V
TESTARGS = -v -args -alsologtostderr -v 5
else
TESTARGS =
endif
all: csi-snapshotter
csi-snapshotter:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/csi-snapshotter ./cmd/csi-snapshotter
clean:
-rm -rf bin
container: csi-snapshotter
docker build -t $(IMAGE_TAG) .
push: container
docker push $(IMAGE_TAG)
test:
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
go vet `go list ./... | grep -v vendor`