aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2024-03-22 22:55:37 -0700
committerMax Resnick <max@ofmax.li>2024-03-23 21:32:04 -0700
commit773674dfaf1f1679a8add6eeb5f8c8eb8d649d2b (patch)
tree6032d7adb2ef1d23ac73a19e6d8ed3c2c0cfe6a9
parentd82129052e1c99a61abce7c34ea83f508737eeb9 (diff)
downloadgo-git-server-773674dfaf1f1679a8add6eeb5f8c8eb8d649d2b.tar.gz
feat: build, debug etc tasks
-rw-r--r--justfile19
1 files changed, 17 insertions, 2 deletions
diff --git a/justfile b/justfile
index f7ea81f..e60d3ea 100644
--- a/justfile
+++ b/justfile
@@ -1,9 +1,24 @@
TEMPDIR := `mktemp -d`
+BUILDDIR := "_build"
alias dr := debug-run
alias dt := debug-test
-build:
- CGO=0 go build -o go-git-server cmd/main.go
+
+docker:
+ docker build -t go-git-server .
+
+docker-run:
+ docker run -it --rm -p 8080:8080 --volume $(pwd)/tokens.csv:/opt/app/etc/tokens.csv go-git-server
+
+clean:
+ rm -r {{ BUILDDIR }}
+
+builddir:
+ mkdir -p {{ BUILDDIR }}/{bin,etc}
+
+build: test builddir
+ cp policy.csv auth_model.ini gitserver.yaml {{ BUILDDIR }}/etc/
+ CGO_ENABLED=0 go build -a -ldflags '-s' -o {{ BUILDDIR }}//bin/go-git-server cmd/main.go
run:
go run cmd/main.go -s {{justfile_directory()}}/gitserver.yaml -r $(mktemp -d)