* origin/master: (333 commits) chore(deps): bump gunicorn in /tests/apps/dockerfile-release chore(deps): bump importlib-metadata in /docs/_build chore(deps): bump soupsieve from 4.0.1 to 4.1 in /docs/_build chore(deps): bump gunicorn from 26.2.0 to 27.0.0 in /tests/apps/multi chore(deps): bump gunicorn in /tests/apps/python-flask chore: bump pack to 0.40.11 chore(deps): bump pymdown-extensions from 12.3 to 13.0 in /docs/_build chore(deps): bump rack chore(deps): bump sass from 1.108.0 to 1.108.1 in /tests/apps/multi chore(deps): bump mkdocs-material from 9.8.0 to 9.8.1 in /docs/_build chore(deps): bump click from 8.5.0 to 8.5.1 in /docs/_build chore(deps): bump github.com/dokku/dokku-datastore in /plugins/datastore chore(deps): bump golang.org/x/sync in /plugins/common chore(deps): bump sass from 1.107.1 to 1.108.0 in /tests/apps/multi chore(deps): update markdown requirement in /docs/_build chore(deps): bump watchdog from 7.0.0 to 7.1.0 in /docs/_build chore(deps): bump soupsieve from 3.0.4 to 4.0.1 in /docs/_build chore(deps): bump traefik in /plugins/traefik-vhosts fix: build plugins/common on windows chore: bump herokuish to 0.11.25 ... # Conflicts: # common.mk # contrib/dependencies.json
53 lines
1.6 KiB
Makefile
53 lines
1.6 KiB
Makefile
GO_ARGS ?=
|
|
GO_PLUGIN_MAKE_TARGET ?= build
|
|
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
|
|
BUILD_IMAGE := hub.diyla.com/golang:1.27.1
|
|
GO_BUILD_CACHE ?= /tmp/dokku-go-build-cache
|
|
GO_MOD_CACHE ?= /tmp/dokku-go-mod-mod
|
|
GO_ROOT_MOUNT ?= $$PWD/../..:$(GO_REPO_ROOT)
|
|
ifndef TARGETARCH
|
|
TARGETARCH := $(shell dpkg --print-architecture 2>/dev/null || uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')
|
|
endif
|
|
GOARCH ?= $(TARGETARCH)
|
|
|
|
.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 $(GO_ROOT_MOUNT) \
|
|
-v $(GO_BUILD_CACHE):/root/.cache \
|
|
-v $(GO_MOD_CACHE):/go/pkg/mod \
|
|
-e PLUGIN_NAME=$(PLUGIN_NAME) \
|
|
-e GO111MODULE=on \
|
|
-e GOPROXY=https://goproxy.cn,direct \
|
|
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
|
|
$(BUILD_IMAGE) \
|
|
bash -c "GO_ARGS='$(GO_ARGS)' CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) GOWORK=off make -j4 $(GO_PLUGIN_MAKE_TARGET)" || exit $$?
|
|
|
|
clean:
|
|
rm -rf $(BUILD)
|
|
find . -xtype l -delete
|
|
|
|
commands: **/**/commands.go
|
|
GOARCH=$(GOARCH) go build -mod=readonly -ldflags="-s -w" $(GO_ARGS) -o commands src/commands/commands.go
|
|
|
|
subcommands:
|
|
GOARCH=$(GOARCH) go build -mod=readonly -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.* go.sum go.mod
|
|
|
|
triggers:
|
|
GOARCH=$(GOARCH) go build -mod=readonly -ldflags="-s -w" $(GO_ARGS) -o triggers src/triggers/triggers.go
|
|
$(MAKE) $(TRIGGERS)
|
|
|
|
triggers/%:
|
|
ln -sf triggers $(shell echo $@ | cut -d '/' -f2)
|