mirror of
https://github.com/moul/sshportal.git
synced 2024-12-28 11:14:18 +08:00
Add 'make backup' dev helper
This commit is contained in:
parent
3e565365f6
commit
8db6afe8b9
2 changed files with 8 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/sshportal
|
||||
*.db
|
||||
*.db
|
||||
/data
|
6
Makefile
6
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
|
||||
|
|
Loading…
Reference in a new issue