# SeriveNow Makefile to Pass PR builds

##@ General

default: help ## Default target is help

help: ## Display this help.
	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf "  \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Build Info

.PHONY: buildInfo
buildInfo: ## Display build information
	@echo "=== Build Information ==="
	@echo "Commit: $$(git rev-parse HEAD 2>/dev/null || echo 'Not a git repository')"
	@echo "Branch: $$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'Not a git repository')"
	@echo "Build timestamp: $$(date +'%Y-%m-%d %H:%M:%S')"
	@echo "========================="

##@ DevOps CI/CD

.PHONY: pr
pr: ## Pull request workflow
	@echo "=== Running PR workflow ===="
	@echo "Add PR checks for this repo "
	@echo "============================"

.PHONY: ci
ci: pr ## Continuous Integration workflow
	@echo "=== Running CI workflow ============"
	@echo "PR is merged, but nothing to do here"
	@echo "===================================="

.PHONY: cd
cd: ci ## Continuous Deployment workflow
	@echo "=== Running CD workflow ==="
	@echo "Nothing to do here either  "
	@echo "==========================="
