From 8bb040c8b29bc4eaadab70891125be182c0fbe0b Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sat, 11 Aug 2018 01:28:42 -0700 Subject: [PATCH 1/2] Add promu --- .promu.yml | 14 ++++++++++++++ MAINTAINERS.md | 2 ++ Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ NOTICE | 2 ++ VERSION | 1 + 5 files changed, 66 insertions(+) create mode 100644 .promu.yml create mode 100644 MAINTAINERS.md create mode 100644 Makefile create mode 100644 NOTICE create mode 100644 VERSION diff --git a/.promu.yml b/.promu.yml new file mode 100644 index 0000000..bef9919 --- /dev/null +++ b/.promu.yml @@ -0,0 +1,14 @@ +repository: + path: github.com/tombowditch/telly +build: + flags: -a -tags netgo + ldflags: | + -X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}} + -X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}} + -X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}} + -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}} + -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} +tarball: + files: + - LICENSE + - NOTICE diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..2540a31 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,2 @@ +* Tom Bowditch +* Robbie Trencheny diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..437f729 --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +GO := GO15VENDOREXPERIMENT=1 go +PROMU := $(GOPATH)/bin/promu +pkgs = $(shell $(GO) list ./... | grep -v /vendor/) + +PREFIX ?= $(shell pwd) +BIN_DIR ?= $(shell pwd) +DOCKER_IMAGE_NAME ?= telly +DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) + + +all: format build test + +style: + @echo ">> checking code style" + @! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' + +test: + @echo ">> running tests" + @$(GO) test -short $(pkgs) + +format: + @echo ">> formatting code" + @$(GO) fmt $(pkgs) + +vet: + @echo ">> vetting code" + @$(GO) vet $(pkgs) + +build: promu + @echo ">> building binaries" + @$(PROMU) build --prefix $(PREFIX) + +tarball: promu + @echo ">> building release tarball" + @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) + +docker: + @echo ">> building docker image" + @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . + +promu: + @GOOS=$(shell uname -s | tr A-Z a-z) \ + GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ + $(GO) get -u github.com/prometheus/promu + + +.PHONY: all style format build test vet tarball docker promu diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..2757c34 --- /dev/null +++ b/NOTICE @@ -0,0 +1,2 @@ +An IPTV proxy for Plex Live DVR. +Copyright 2018 Tom Bowditch. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..26aaba0 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.2.0 From 2823e4d99909768e6c2d6b37fce3bbce7c48eed4 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sat, 11 Aug 2018 01:38:43 -0700 Subject: [PATCH 2/2] Add promu stuff to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 027b040..a22990c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ telly /bin *.xml vendor/ +/.build +/.release +/.tarballs +*.tar.gz