45 lines
807 B
Makefile
45 lines
807 B
Makefile
|
build: vendor
|
||
|
CGO_ENABLED=0 go build -mod=vendor -v -o bin/server ./cmd/server
|
||
|
|
||
|
test:
|
||
|
go test -v -race ./...
|
||
|
|
||
|
release:
|
||
|
@$(SHELL) ./misc/script/release.sh
|
||
|
|
||
|
vendor:
|
||
|
go mod vendor
|
||
|
|
||
|
tidy:
|
||
|
go mod tidy
|
||
|
|
||
|
watch:
|
||
|
modd
|
||
|
|
||
|
lint:
|
||
|
golangci-lint run --enable-all
|
||
|
|
||
|
hydra:
|
||
|
docker run \
|
||
|
--rm -it \
|
||
|
--name hydra-passwordless \
|
||
|
-e DSN=memory \
|
||
|
-e URLS_LOGIN=http://localhost:3000/login \
|
||
|
-e URLS_CONSENT=http://localhost:3000/consent \
|
||
|
-p 4444:4444 \
|
||
|
-p 4445:4445 \
|
||
|
oryd/hydra:v1.4.2-alpine \
|
||
|
serve all \
|
||
|
--dangerous-force-http
|
||
|
|
||
|
create-client:
|
||
|
docker exec -it hydra-passwordless \
|
||
|
sh -c 'HYDRA_URL=http://localhost:4445 hydra clients create -c http://localhost:3000/test/oauth2/callback'
|
||
|
|
||
|
clean:
|
||
|
rm -rf release
|
||
|
rm -rf data
|
||
|
rm -rf vendor
|
||
|
rm -rf bin
|
||
|
|
||
|
.PHONY: lint watch build vendor tidy release
|