54 lines
1.1 KiB
Makefile
54 lines
1.1 KiB
Makefile
DOKKU_HOST := dokku@dev.lookingfora.name
|
|
SHELL := /bin/bash
|
|
DOCKER_IMAGE_NAME ?= bornholm/oidc-test
|
|
DOCKER_IMAGE_TAG ?= $(shell git describe)
|
|
|
|
build:
|
|
CGO_ENABLED=0 go build -v -o ./bin/server ./cmd/server
|
|
|
|
test:
|
|
go test -v -race ./...
|
|
|
|
release:
|
|
@$(SHELL) ./misc/script/release.sh
|
|
|
|
tidy:
|
|
go mod tidy
|
|
|
|
watch:
|
|
modd
|
|
|
|
lint:
|
|
golangci-lint run --enable-all
|
|
|
|
clean:
|
|
rm -rf release
|
|
rm -rf data
|
|
rm -rf bin
|
|
|
|
dokku-build:
|
|
docker build \
|
|
-f ./misc/dokku/Dockerfile \
|
|
-t goweb-oidc-dokku:latest \
|
|
.
|
|
|
|
dokku-run:
|
|
docker run -it --rm -p 3002:3002 goweb-oidc-dokku:latest
|
|
|
|
dokku-deploy:
|
|
$(if $(shell git config remote.dokku-oidc-test.url),, git remote add dokku-oidc-test $(DOKKU_HOST):oidc-test)
|
|
git push -f dokku-oidc-test $(shell git rev-parse HEAD):refs/heads/master
|
|
|
|
docker-build:
|
|
docker build \
|
|
-f ./misc/dokku/Dockerfile \
|
|
-t $(DOCKER_IMAGE_NAME):latest \
|
|
.
|
|
|
|
docker-release: docker-build
|
|
docker image tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
|
|
docker login
|
|
docker push $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
|
|
docker push $(DOCKER_IMAGE_NAME):latest
|
|
|
|
.PHONY: lint watch build vendor tidy release |