rebound/Makefile

49 lines
966 B
Makefile

SHELL := /bin/bash
DOKKU_URL := dokku@dev.lookingfora.name:rebound
all: build
watch: tools/modd/bin/modd
tools/modd/bin/modd
socks:
mkdir -p ./socks
run: .env socks
( set -o allexport && source .env && set +o allexport && bin/server )
build: .env
CGO_ENABLED=0 go build -o ./bin/server ./cmd/server
.env:
cp .env.dist .env
dokku-build:
docker build \
-t rebound-dokku:latest \
.
dokku-run:
docker run \
-it --rm \
-p 2222:2222 \
--tmpfs /socks \
rebound-dokku:latest
dokku-deploy:
$(if $(shell git config remote.dokku.url),, git remote add dokku $(DOKKU_URL))
git push -f dokku $(shell git rev-parse HEAD):refs/heads/master
.PHONY: mktools
mktools:
rm -rf .mktools
curl -q https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/install.sh | $(SHELL)
tools/modd/bin/modd:
mkdir -p tools/modd/bin
GOBIN=$(PWD)/tools/modd/bin go install github.com/cortesi/modd/cmd/modd@v0.8.1
.mktools:
$(MAKE) mktools
-include .mktools/*.mk