*: add code to serialize templates into go code
Add a small program to iterate over the templates directory and generate a go map of name to file data. This is so we can compile these templates into the dex binary instead of requiring files on disk. Also add a Makefile rule to do this automatically.
This commit is contained in:
5
Makefile
5
Makefile
@@ -19,7 +19,7 @@ GOARCH=$(shell go env GOARCH)
|
||||
|
||||
build: bin/dex bin/example-app
|
||||
|
||||
bin/dex: FORCE
|
||||
bin/dex: FORCE server/templates_default.go
|
||||
@go install -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex
|
||||
|
||||
bin/example-app: FORCE
|
||||
@@ -42,6 +42,9 @@ lint:
|
||||
golint $$package; \
|
||||
done
|
||||
|
||||
server/templates_default.go: $(wildcard web/templates/**)
|
||||
@go run server/templates_default_gen.go
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build: bin/dex
|
||||
@docker build -t $(DOCKER_IMAGE) .
|
||||
|
Reference in New Issue
Block a user