--- /dev/null
+VERSION := $(shell git describe --always --dirty)
+
+help:
+ @echo 'make build - build the passage executable'
+ @echo 'make tag - tag the current HEAD with VERSION'
+ @echo 'make archive - create an archive of the current HEAD for VERSION'
+ @echo 'make upload - upload the built archive of VERSION to Amazon S3'
+ @echo 'make all - build, tag, archive and upload VERSION'
+
+version:
+ @if [ "$$VERSION" = "" ]; then echo "VERSION not set"; exit 1; fi
+
+passage_linux:
+ @echo 'Unsupported architecture: $@'
+
+passage_darwin:
+ GOOS=darwin GOARCH=amd64 go build -ldflags="-X main.version=${VERSION}" -o passage_darwin passage.go
+
+passage_all: passage_linux passage_darwin
+
+passage: passage.go
+ go build -ldflags="-X main.version=${VERSION}" $^
+
+build: passage
+
+tag: version
+ git tag -s $$VERSION -m "$$VERSION release"
+
+archive: passage-${VERSION}.zip
+
+passage-${VERSION}.zip: passage
+ git archive -o $@ HEAD
+ zip $@ passage
+
+upload: passage-${VERSION}.zip
+ aws --curl-options=--insecure put s3.wincent.com/passage/releases/passage-${VERSION}.zip passage-${VERSION}.zip
+ aws --curl-options=--insecure put "s3.wincent.com/passage/releases/passage-${VERSION}.zip?acl" --public
+
+all: tag build archive upload
+
+.PHONY: clean
+clean:
+ rm -f passage passage-*.zip
+ rm -f passage_*
}
var cache map[string][]byte
+var version = "unknown"
func main() {
resetCache()
go handleConnection(conn)
}
}()
- log.Print("Open and ready for business on UNIX socket at ", path)
+ log.Print("passage (version ", version, ") ready for business on UNIX socket at ", path)
reload := make(chan os.Signal, 1)
signal.Notify(reload, syscall.SIGUSR1)