From 054c612f6b6a1fb6e131d512e6fca430fa83f948 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 24 Jan 2019 17:30:10 +0100 Subject: [PATCH] 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. --- .travis.yml | 14 +------------- Makefile | 34 +++------------------------------- pkg/controller/util.go | 2 +- 3 files changed, 5 insertions(+), 45 deletions(-) mode change 100644 => 120000 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 44bdf8ba..00000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/.travis.yml b/.travis.yml new file mode 120000 index 00000000..a554dfc7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +release-tools/travis.yml \ No newline at end of file diff --git a/Makefile b/Makefile index e9c8249e..4a81c510 100644 --- a/Makefile +++ b/Makefile @@ -14,34 +14,6 @@ .PHONY: all csi-snapshotter clean test -REGISTRY_NAME=quay.io/k8scsi -IMAGE_NAME=csi-snapshotter -IMAGE_VERSION=canary -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` +CMDS=csi-snapshotter +all: build +include release-tools/build.make diff --git a/pkg/controller/util.go b/pkg/controller/util.go index 4e2056f7..b6d2ca3e 100644 --- a/pkg/controller/util.go +++ b/pkg/controller/util.go @@ -68,7 +68,7 @@ const ( ) var snapshotterSecretParams = deprecatedSecretParamsMap{ - name: "Snapshotter", + name: "Snapshotter", deprecatedSecretNameKey: snapshotterSecretNameKey, deprecatedSecretNamespaceKey: snapshotterSecretNamespaceKey, secretNameKey: prefixedSnapshotterSecretNameKey,