Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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/git-rebase
  5. IMAGE_TAG ?= 1.0
  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: FORCE
  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 FORCE
  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 $(ARGS) origin/master
  25. delete-backups: build FORCE
  26. @echo "Running ai-commit.sh using image: $(FULL_IMAGE_NAME)..."
  27. @echo "Passing arguments: $(ARGS)"
  28. # Pass the image name via environment variable and arguments to the script
  29. DOCKER_IMAGE_NAME=$(FULL_IMAGE_NAME) ./ai-rebase.sh $(ARGS) --delete-backups