76 lines
1.5 KiB
Makefile
76 lines
1.5 KiB
Makefile
DOKKU_HOST := dokku@dev.lookingfora.name
|
|
SHELL := /bin/bash
|
|
|
|
build: vendor
|
|
CGO_ENABLED=0 go build -mod=vendor -v -o bin/server ./cmd/server
|
|
|
|
test:
|
|
go test -v -race ./...
|
|
|
|
release: vendor
|
|
@$(SHELL) ./misc/script/release.sh
|
|
|
|
vendor:
|
|
go mod vendor
|
|
|
|
tidy:
|
|
go mod tidy
|
|
|
|
watch:
|
|
modd
|
|
|
|
lint:
|
|
golangci-lint run --enable-all
|
|
|
|
up:
|
|
docker-compose up --build
|
|
|
|
down:
|
|
docker-compose down -v --remove-orphans
|
|
|
|
create-default-client:
|
|
docker-compose exec \
|
|
-e HYDRA_URL=http://localhost:4445 \
|
|
hydra \
|
|
hydra clients create \
|
|
-c http://localhost:3002/oauth2/callback \
|
|
--post-logout-callbacks http://localhost:3002
|
|
|
|
|
|
list-clients:
|
|
docker-compose exec \
|
|
-e HYDRA_URL=http://localhost:4445 \
|
|
hydra \
|
|
hydra clients list
|
|
|
|
hydra-interactive:
|
|
docker-compose exec \
|
|
-e HYDRA_URL=http://localhost:4445 \
|
|
hydra \
|
|
/bin/sh
|
|
|
|
dokku-build:
|
|
docker build \
|
|
-t hydra-passwordless-dokku:latest \
|
|
.
|
|
|
|
dokku-run:
|
|
docker run -it --rm -p 4444:4444 -p 3002:3002 hydra-passwordless-dokku:latest
|
|
|
|
dokku-deploy: dokku-deploy-passwordless dokku-deploy-sso
|
|
|
|
dokku-deploy-passwordless:
|
|
$(if $(shell git config remote.dokku-passwordless.url),, git remote add dokku-passwordless $(DOKKU_HOST):passwordless)
|
|
git push -f dokku-passwordless $(shell git rev-parse HEAD):refs/heads/master
|
|
|
|
dokku-deploy-sso:
|
|
$(if $(shell git config remote.dokku-sso.url),, git remote add dokku-sso $(DOKKU_HOST):sso)
|
|
git push -f dokku-sso $(shell git rev-parse HEAD):refs/heads/master
|
|
|
|
clean:
|
|
rm -rf release
|
|
rm -rf data
|
|
rm -rf vendor
|
|
rm -rf bin
|
|
|
|
.PHONY: lint watch build vendor tidy release |