Makefile 1005 B

12345678910111213141516171819202122232425262728293031323334
  1. # Makefile for AI Commit Tool
  2. # === Variables ===
  3. # Override these on the command line like: make build IMAGE_TAG=2.0
  4. IMAGE_NAME ?= docker.senomas.com/commit
  5. IMAGE_TAG ?= 1.1
  6. # Full image reference used in commands
  7. FULL_IMAGE_NAME = $(IMAGE_NAME):$(IMAGE_TAG)
  8. # Pass arguments to the run script via ARGS
  9. # Example: make run ARGS="-a"
  10. ARGS ?=
  11. # === Targets ===
  12. # Phony targets are not files
  13. .PHONY: help build run delete-backups
  14. # Default target when running 'make'
  15. .DEFAULT_GOAL := run
  16. build: ## Build the Docker image
  17. @echo "Building Docker image: $(FULL_IMAGE_NAME)..."
  18. docker build -t $(FULL_IMAGE_NAME) .
  19. @echo "Build complete: $(FULL_IMAGE_NAME)"
  20. run: build
  21. @echo "Running ai-commit.sh using image: $(FULL_IMAGE_NAME)..."
  22. @echo "Passing arguments: $(ARGS)"
  23. # Pass the image name via environment variable and arguments to the script
  24. DOCKER_IMAGE_NAME=$(FULL_IMAGE_NAME) ./ai-rebase.sh -r origin/master $(ARGS)
  25. delete-backups:
  26. git branch --list 'master-backup-*' | xargs git branch -D