Files
dokku/common.mk
Jose Diaz-Gonzalez 45e3623ffd refactor: switch to go mod
This hopefully makes it a little easier to work with as the tooling is now based on something in golang core.

- move columnize usage to common plugin
- remove old vendor files
2020-06-28 01:11:28 -04:00

43 lines
1.1 KiB
Makefile

GO_ARGS ?= -a
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
BUILD_IMAGE := golang:1.14.4
.PHONY: build-in-docker build clean src-clean
build: $(BUILD)
build-in-docker: clean
mkdir -p /tmp/dokku-go-build-cache
docker run --rm \
-v $$PWD/../..:$(GO_REPO_ROOT) \
-v /tmp/dokku-go-build-cache:/root/.cache \
-e PLUGIN_NAME=$(PLUGIN_NAME) \
-e GO111MODULE=on \
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
$(BUILD_IMAGE) \
bash -c "GO_ARGS='$(GO_ARGS)' make -j4 build" || exit $$?
clean:
rm -rf commands subcommands triggers prop
find . -xtype l -delete
commands: **/**/commands.go
go build -ldflags="-s -w" $(GO_ARGS) -o commands src/commands/commands.go
subcommands:
go build -ldflags="-s -w" $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go
$(MAKE) $(SUBCOMMANDS)
subcommands/%:
ln -sf subcommands $@
src-clean:
rm -rf .gitignore src vendor Makefile *.go glide.*
triggers:
go build -ldflags="-s -w" $(GO_ARGS) -o triggers src/triggers/triggers.go
$(MAKE) $(TRIGGERS)
triggers/%:
ln -sf triggers $(shell echo $@ | cut -d '/' -f2)