Browse Source

Build command tweaks

Ask Bjørn Hansen 7 years ago
parent
commit
58ca629fa8
2 changed files with 13 additions and 8 deletions
  1. 4 5
      Makefile
  2. 9 3
      build

+ 4 - 5
Makefile

@@ -1,8 +1,7 @@
-all: templates.go
-	./build
 
-templates.go: templates/*.html monitor.go
-	go generate
+# where to rsync builds
+DIST?=dist/publish
+DISTSUB=2018/04
 
 test: .PHONY
 	go test -v $(shell go list ./... | grep -v /vendor/)
@@ -27,7 +26,7 @@ TARS=$(wildcard geodns-*-*.tar)
 
 push: $(TARS) tmp-install.sh
 	#rsync -avz tmp-install.sh $(TARS)  x3.dev:webtmp/2018/04/
-	rsync tmp-install.sh $(TARS) $(DIST)/$(DISTSUB)/
+	rsync --exclude publish tmp-install.sh $(TARS) $(DIST)/$(DISTSUB)/
 	$(DIST)/push
 
 builds: linux-build linux-build-i386 freebsd-build push

+ 9 - 3
build

@@ -1,4 +1,7 @@
 #!/bin/sh
+
+set -ex
+
 echo building
 # git describe --always --tags --dirty --long)
 REVISION=`git rev-parse --short=5  HEAD`
@@ -10,8 +13,11 @@ ARCH=${GOARCH:-`go env GOARCH`}
 
 set -ex
 
-go build -o geodns-$OS-$ARCH \
+go build -o dist/geodns-$OS-$ARCH \
   -ldflags "-X main.gitVersion=$REVISION -X main.buildTime=$BUILDTIME" \
   -v && \
-  (cd geodns-influxdb && go build -v -o geodns-influxdb-$OS-$ARCH && cd ..) && \
-tar -cvf geodns-$OS-$ARCH.tar --exclude \*~ geodns-$OS-$ARCH geodns-influxdb/geodns-influxdb-$OS-$ARCH service service-influxdb
+  (cd geodns-influxdb && go build -v -o ../dist/geodns-influxdb-$OS-$ARCH && cd ..) && \
+cd dist && \
+tar -cvHf geodns-$OS-$ARCH.tar \
+ --exclude \*~ geodns-$OS-$ARCH \
+ geodns-influxdb-$OS-$ARCH service service-influxdb