From 96197af3f1a84ae4120c70b874c32cdb8a0cef3f Mon Sep 17 00:00:00 2001 From: Emile Vauge Date: Sun, 5 Feb 2017 16:42:04 +0100 Subject: [PATCH] Add glide hash validation Signed-off-by: Emile Vauge --- Makefile | 2 +- build.Dockerfile | 3 ++- script/validate-glide | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 script/validate-glide diff --git a/Makefile b/Makefile index 6f687df46..561a6ab0c 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ test-integration: build ## run the integration tests $(DOCKER_RUN_TRAEFIK) ./script/make.sh generate test-integration validate: build ## validate gofmt, golint and go vet - $(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-gofmt validate-govet validate-golint validate-misspell + $(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-glide validate-gofmt validate-govet validate-golint validate-misspell build: dist docker build $(DOCKER_BUILD_ARGS) -t "$(TRAEFIK_DEV_IMAGE)" -f build.Dockerfile . diff --git a/build.Dockerfile b/build.Dockerfile index aaa8dac52..25d9f4776 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -3,7 +3,8 @@ FROM golang:1.7 RUN go get github.com/jteeuwen/go-bindata/... \ && go get github.com/golang/lint/golint \ && go get github.com/kisielk/errcheck \ -&& go get github.com/client9/misspell/cmd/misspell +&& go get github.com/client9/misspell/cmd/misspell \ +&& go get github.com/mattfarina/glide-hash # Which docker version to test on ARG DOCKER_VERSION=1.10.3 diff --git a/script/validate-glide b/script/validate-glide new file mode 100755 index 000000000..d5a756c85 --- /dev/null +++ b/script/validate-glide @@ -0,0 +1,14 @@ +#!/bin/bash + +source "$(dirname "$BASH_SOURCE")/.validate" + +grep `glide-hash` glide.lock +if [ $? -eq 0 ]; then + echo 'Congratulations! glide.lock is unchanged.' +else + { + echo "Error: glide.lock has been manually changed. Don't do this. Use glide up instead." + echo + } >&2 + false +fi