From 07c0e179b39edcaf23217348a3640beb9a73ac23 Mon Sep 17 00:00:00 2001 From: aermakov-zalando Date: Tue, 1 Oct 2019 11:54:37 +0200 Subject: [PATCH] Fail on dirty and/or non-exact versions on master (#79) * Fail on dirty and/or non-exact versions on master Signed-off-by: Alexey Ermakov * Prevent go from modifying go.mod Signed-off-by: Alexey Ermakov * Fix go.mod version Signed-off-by: Alexey Ermakov * Allow non-exact tag matches Signed-off-by: Alexey Ermakov --- delivery.yaml | 6 +++++- go.mod | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/delivery.yaml b/delivery.yaml index 26d9157..179b9ad 100644 --- a/delivery.yaml +++ b/delivery.yaml @@ -7,6 +7,8 @@ pipeline: - /go/pkg/mod # pkg cache for Go modules - ~/.cache/go-build # Go build cache type: script + env: + GOFLAGS: "-mod=readonly" commands: - desc: test cmd: | @@ -18,9 +20,11 @@ pipeline: cmd: | if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter - VERSION=$(git describe --tags --always --dirty) + VERSION=$(git describe --tags --always) else IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test VERSION=$CDP_BUILD_VERSION fi + IMAGE=$IMAGE VERSION=$VERSION make build.docker + git diff --stat --exit-code IMAGE=$IMAGE VERSION=$VERSION make build.push diff --git a/go.mod b/go.mod index af6c2a4..ea8f755 100644 --- a/go.mod +++ b/go.mod @@ -89,3 +89,5 @@ require ( k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c // indirect k8s.io/metrics v0.0.0-20190226180357-f3f09b9076d1 ) + +go 1.13