summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-22 18:12:38 -0600
committermo khan <mo@mokhan.ca>2025-07-22 18:12:38 -0600
commitf8ad9adbfd9b6929f937665f81ec64d00bd1bb6b (patch)
tree3ab51167b8045bb90c61ba7376f41085e0c6164f
parentfc0b1125403d5fe6edb69859a6387d2c069296eb (diff)
chore: add shell script to wrap zed cli
-rw-r--r--Makefile17
-rwxr-xr-xbin/zed3
2 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 1fb0088..d9ea8d6 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,9 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')
IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH)
AUTHZD_BIN := bin/authzd
SPARKLED_BIN := bin/sparkled
-ZED_CMD = go tool godotenv -f .env.local,.env go tool zed --insecure
+ZED := bin/zed
-.PHONY: clean setup build test run
+.PHONY: clean setup build test run db-setup
$(AUTHZD_BIN): $(shell find . -name "*.go" 2>/dev/null) go.sum
@go build -o $(AUTHZD_BIN) ./cmd/authzd/main.go
@@ -52,8 +52,8 @@ run-image: clean build-image
lint:
@go tool yamlfmt --lint -exclude vendor .
- @$(ZED_CMD) validate etc/authzd/*.zed
- @$(ZED_CMD) validate etc/authzd/*.yaml
+ @$(ZED) validate etc/authzd/*.zed
+ @$(ZED) validate etc/authzd/*.yaml
tidy:
@go get -u ./...
@@ -62,10 +62,9 @@ tidy:
@go tool yamlfmt -exclude vendor .
db-schema-load:
- @$(ZED_CMD) schema write etc/authzd/schema.zed
-
-db-schema:
- @$(ZED_CMD) schema read
+ @$(ZED) schema write etc/authzd/schema.zed
db-seed:
- @$(ZED_CMD) import etc/authzd/relationships.yaml
+ @$(ZED) import etc/authzd/relationships.yaml
+
+db-setup: db-schema-load db-seed
diff --git a/bin/zed b/bin/zed
new file mode 100755
index 0000000..77dc0d8
--- /dev/null
+++ b/bin/zed
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+go tool godotenv -f .env.local,.env go tool zed --insecure $@