Skip to content

Commit

Permalink
check go version when building
Browse files Browse the repository at this point in the history
  • Loading branch information
liggitt committed Apr 24, 2018
1 parent 0d6dbf5 commit 4d552d1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ update-deps:
clean-deps:
rm -fr vendor

build:
build: check_go_version
go build -o bin/audit2rbac $(shell ./build/print-ldflags.sh) ./cmd/audit2rbac

build-cross:
build-cross: check_go_version
./build/build-cross.sh cmd/audit2rbac/audit2rbac.go

install:
Expand Down Expand Up @@ -58,3 +58,11 @@ lint:
echo "$$OUTPUT"; \
exit 1; \
fi

check_go_version:
@OUTPUT=`go version`; \
if [[ "$$OUTPUT" != *"go1.9."* ]]; then \
echo "Expected: go version go1.9.*"; \
echo "Found: $$OUTPUT"; \
exit 1; \
fi

0 comments on commit 4d552d1

Please sign in to comment.