Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 ?= senomas/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. docker push $(FULL_IMAGE_NAME)
  21. run: build FORCE
  22. @echo "Running ai-commit.sh using image: $(FULL_IMAGE_NAME)..."
  23. @echo "Passing arguments: $(ARGS)"
  24. # Pass the image name via environment variable and arguments to the script
  25. DOCKER_IMAGE_NAME=$(FULL_IMAGE_NAME) ./ai-rebase.sh $(ARGS) origin/master
  26. delete-backups: build FORCE
  27. @echo "Running ai-commit.sh using image: $(FULL_IMAGE_NAME)..."
  28. @echo "Passing arguments: $(ARGS)"
  29. # Pass the image name via environment variable and arguments to the script
  30. DOCKER_IMAGE_NAME=$(FULL_IMAGE_NAME) ./ai-rebase.sh $(ARGS) --delete-backups