Add 'make backup' dev helper

This commit is contained in:
Manfred Touron 2017-11-14 09:57:21 +01:00
parent 3e565365f6
commit 8db6afe8b9
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
/sshportal
*.db
*.db
/data

View file

@ -2,6 +2,7 @@ GIT_SHA ?= $(shell git rev-parse HEAD)
GIT_TAG ?= $(shell git describe --tags --always)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
LDFLAGS ?= -X main.GIT_SHA=$(GIT_SHA) -X main.GIT_TAG=$(GIT_TAG) -X main.GIT_BRANCH=$(GIT_BRANCH)
VERSION ?= $(shell grep 'VERSION =' main.go | cut -d'"' -f2)
.PHONY: install
install:
@ -20,3 +21,8 @@ dev:
test:
go test -i .
go test -v .
.PHONY: backup
backup:
mkdir -p data/backups
cp sshportal.db data/backups/$(shell date +%s)-$(VERSION)-sshportal.sqlite