From baef89a8f619f2e03a96a3551a0a9bdd727fa609 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 17 Feb 2016 20:30:06 -0800 Subject: [PATCH 1/4] Removes from cruft from the makefile. --- GNUmakefile | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 4602852995..ceb8f9340f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,15 +9,15 @@ all: format tools @mkdir -p bin/ @bash --norc -i ./scripts/build.sh -# bin generates the releasable binaries -bin: generate +# bin generates binaries for all platforms +bin: @sh -c "'$(CURDIR)/scripts/build.sh'" # dev creates binaries for testing locally - these are put into ./bin and $GOPATH -dev: generate +dev: @CONSUL_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" -# dist creates the binaries for distibution +# dist packages the binaries for distibution dist: bin @sh -c "'$(CURDIR)/scripts/dist.sh' $(VERSION)" @@ -31,7 +31,6 @@ test: @./scripts/test.sh cover: - ./scripts/verify_no_uuid.sh go list ./... | xargs -n1 go test --cover format: @@ -54,12 +53,7 @@ vet: echo "and fix them if necessary before submitting the code for reviewal."; \ fi -# generate runs `go generate` to build the dynamically generated source files -generate: - find . -type f -name '.DS_Store' -delete - go generate ./... - -# generates the static web ui +# generates the static web ui that's compiled into the binary static-assets: @echo "--> Generating static assets" @go-bindata-assetfs -pkg agent -prefix pkg ./pkg/web_ui/... @@ -69,10 +63,4 @@ static-assets: tools: go get -u -v $(GOTOOLS) -web: - ./scripts/website_run.sh - -web-push: - ./scripts/website_push.sh - -.PHONY: all bin dev dist cov test vet web web-push generate static-assets tools +.PHONY: all bin dev dist cov test cover format vet static-assets tools From 3f7bd5dec2832b315605558b16fe53d43da751fe Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 17 Feb 2016 20:36:48 -0800 Subject: [PATCH 2/4] Tweaks some of the default makefile targets. --- GNUmakefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index ceb8f9340f..a2f093e93a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,27 +5,24 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \ -nilfunc -printf -rangeloops -shift -structtags -unsafeptr VERSION?=$(shell awk -F\" '/^const Version/ { print $$2; exit }' version.go) -all: format tools +# all builds binaries for all targets +all: tools @mkdir -p bin/ - @bash --norc -i ./scripts/build.sh - -# bin generates binaries for all platforms -bin: @sh -c "'$(CURDIR)/scripts/build.sh'" # dev creates binaries for testing locally - these are put into ./bin and $GOPATH -dev: +dev: format @CONSUL_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" -# dist packages the binaries for distibution -dist: bin +# dist builds binaries for all platforms and packages them for distribution +dist: @sh -c "'$(CURDIR)/scripts/dist.sh' $(VERSION)" cov: gocov test ./... | gocov-html > /tmp/coverage.html open /tmp/coverage.html -test: +test: format @$(MAKE) vet @./scripts/verify_no_uuid.sh @./scripts/test.sh From 33829cdc3444737ce2235bfa2f56ebcb20a0420e Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 17 Feb 2016 23:16:47 -0800 Subject: [PATCH 3/4] Moves release build into Docker container and adds web asset check at dist time. --- Vagrantfile | 72 ------------------------------- scripts/build.sh | 1 + scripts/consul-builder/Dockerfile | 27 ++++++++++++ scripts/dist.sh | 24 ++++------- scripts/dist_build.sh | 47 ++++++++++++++++++++ scripts/fixup_times.sh | 10 +++++ 6 files changed, 94 insertions(+), 87 deletions(-) delete mode 100755 Vagrantfile create mode 100644 scripts/consul-builder/Dockerfile create mode 100755 scripts/dist_build.sh create mode 100755 scripts/fixup_times.sh diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100755 index bade237b59..0000000000 --- a/Vagrantfile +++ /dev/null @@ -1,72 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = '2' - -@script = <