make shorturl persist

This commit is contained in:
Xuu
2020-09-07 10:45:20 -06:00
parent b48b20f68e
commit 9049ab043e
7 changed files with 132 additions and 33 deletions

View File

@@ -3,8 +3,12 @@ DOCS_ASSET=src/docs/bindata.go
SOURCE=$(wildcard cmd/paste/*.go) $(filter-out src/routes/bindata.go, $(wildcard src/routes/*.go))
BINARY=paste
PKG=./cmd/paste
VERSION:=$(shell debian/inc_version.sh -p $(shell git describe --tags `git rev-list --tags --max-count=1`))
VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`|cut -b2-)
VERSION_PAT=$(shell debian/inc_version.sh -p $(VERSION))
VERSION_MIN=$(shell debian/inc_version.sh -m $(VERSION))
VERSION_MAJ=$(shell debian/inc_version.sh -M $(VERSION))
DATE:=$(shell date -u +%FT%TZ)
define DUMMY_BINDATA
@@ -27,7 +31,9 @@ test: $(ROUTE_ASSET) $(DOCS_ASSET)
go test ./...
go vet ./...
run: $(BINARY)
./$(BINARY) -vv serve
go run \
-ldflags "-X main.AppVersion=$(VERSION_PAT) -X main.AppBuild=$(DATE)" \
$(PKG) -vv serve
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(DOCS_ASSET)
go build -v \
@@ -48,6 +54,7 @@ $(DOCS_ASSET):
echo "$$DUMMY_BINDATA" > src/docs/bindata.go
go generate "sour.is/x/paste/cmd/paste"
go generate "sour.is/x/paste/src/docs"
deploy: $(SOURCE) $(ROUTE_ASSET)
cd debian && make