mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-30 23:49:10 +08:00
b59ccc52ae
增加 Supervisor 状态读取 初始化 启动 重启 设置 日志 功能 Refs https://github.com/1Panel-dev/1Panel/issues/1754 Refs https://github.com/1Panel-dev/1Panel/issues/1409 Refs https://github.com/1Panel-dev/1Panel/issues/1388 Refs https://github.com/1Panel-dev/1Panel/issues/379 Refs https://github.com/1Panel-dev/1Panel/issues/353 Refs https://github.com/1Panel-dev/1Panel/issues/331
35 lines
918 B
Makefile
35 lines
918 B
Makefile
GOCMD=go
|
|
GOBUILD=$(GOCMD) build
|
|
GOCLEAN=$(GOCMD) clean
|
|
GOARCH=$(shell go env GOARCH)
|
|
GOOS=$(shell go env GOOS )
|
|
|
|
BASE_PAH := $(shell pwd)
|
|
BUILD_PATH = $(BASE_PAH)/build
|
|
WEB_PATH=$(BASE_PAH)/frontend
|
|
SERVER_PATH=$(BASE_PAH)/backend
|
|
MAIN= $(BASE_PAH)/cmd/server/main.go
|
|
APP_NAME=1panel
|
|
ASSERT_PATH= $(BASE_PAH)/cmd/server/web/assets
|
|
|
|
clean_assets:
|
|
rm -rf $(ASSERT_PATH)
|
|
|
|
upx_bin:
|
|
upx $(BUILD_PATH)/$(APP_NAME)
|
|
|
|
build_frontend:
|
|
cd $(WEB_PATH) && npm install && npm run build:pro
|
|
|
|
build_backend_on_linux:
|
|
cd $(SERVER_PATH) \
|
|
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
|
|
|
build_backend_on_darwin:
|
|
cd $(SERVER_PATH) \
|
|
&& GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
|
|
|
build_all: build_frontend build_backend_on_linux
|
|
|
|
build_on_local: clean_assets build_frontend build_backend_on_darwin upx_bin
|