diff --git a/.gitignore b/.gitignore index 5c67e98..91db390 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /sshportal -*.db \ No newline at end of file +*.db +/data \ No newline at end of file diff --git a/Makefile b/Makefile index 96be17c..2f504c7 100644 --- a/Makefile +++ b/Makefile @@ -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