Maintain consistent Makefile patterns across all components to improve build reliability and developer experience in CI/CD pipelines. Key practices to follow:
Maintain consistent Makefile patterns across all components to improve build reliability and developer experience in CI/CD pipelines.
Key practices to follow:
.PHONY
targets for all rules to prevent conflicts with actual files:
.PHONY: build docker-build docker-push image
TAG ?= $(shell git describe --tags --always)
docker-build:
docker build -t ${IMG}:${TAG} -f Dockerfile .
docker-push:
docker push ${IMG}:${TAG}
image: docker-build docker-push
# Instead of:
# cd .. && docker build -t ${IMG}:${TAG} -f Dockerfile .
# Prefer:
docker build -t ${IMG}:${TAG} -f Dockerfile ..
These standardized patterns make it easier for developers to work across different components, improve CI/CD pipeline reliability, and reduce confusion when building and deploying components.
Enter the URL of a public GitHub repository