You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 regels
895 B

  1. FRONTEND_DIR = ./web
  2. BACKEND_DIR = .
  3. .PHONY: all build-frontend start-backend docker-build docker-push
  4. all: build-frontend start-backend
  5. build-frontend:
  6. @echo "Building frontend..."
  7. @cd $(FRONTEND_DIR) && bun install && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run build
  8. start-backend:
  9. @echo "Starting backend dev server..."
  10. @cd $(BACKEND_DIR) && go run main.go &
  11. # Docker 配置
  12. DOCKER_REGISTRY := registry.cn-hangzhou.aliyuncs.com/fengsilin/new-api
  13. BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//-/g')
  14. BUILD_TIME := $(shell date +%Y%m%d%H%M)
  15. DOCKER_TAG := $(DOCKER_REGISTRY):$(BUILD_TIME)-$(BRANCH_NAME)
  16. docker-build:
  17. @echo "Building Docker image with tag: $(DOCKER_TAG)"
  18. docker build -t $(DOCKER_TAG) .
  19. #docker push $(DOCKER_TAG)
  20. docker-push: docker-build
  21. @echo "Pushing Docker image: $(DOCKER_TAG)"
  22. docker push $(DOCKER_TAG)