hydra-webauthn/Makefile

60 lines
1.3 KiB
Makefile

SHELL := /bin/bash
DOCKER_IMAGE_NAME ?= reg.cadoles.com/wpetit/hydra-webauthn
build:
CGO_ENABLED=0 go build -v -o bin/server ./cmd/server
test:
go test -v -race ./...
tidy:
go mod tidy
watch: tools/modd/bin/modd .env
( set -o allexport && source .env && set +o allexport && tools/modd/bin/modd )
.env:
cp .env.dist .env
lint:
golangci-lint run --enable-all
up:
docker-compose up --build
down:
docker-compose down -v --remove-orphans
docker-build:
docker build \
--build-arg="HTTP_PROXY=$(HTTP_PROXY)" \
--build-arg="HTTPS_PROXY=${HTTP_PROXY}" \
--build-arg="https_proxy=${https_proxy}" \
--build-arg="http_proxy=${http_proxy}" \
-t hydra-webauthn:latest \
-f ./misc/docker/Dockerfile \
.
docker-run:
docker run \
-it --rm \
-p 3000:3000 \
hydra-webauthn:latest
docker-release: docker-build
docker image tag hydra-webauthn:latest $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
docker image tag hydra-webauthn:latest $(DOCKER_IMAGE_NAME):latest
docker login
docker push $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
docker push $(DOCKER_IMAGE_NAME):latest
clean:
rm -rf release
rm -rf data
rm -rf bin
.PHONY: lint watch build tidy release
tools/modd/bin/modd:
mkdir -p tools/modd/bin
GOBIN=$(PWD)/tools/modd/bin go install github.com/cortesi/modd/cmd/modd@latest