<commit_before>.PHONY: help test build
.DEFAULT_GOAL := help

help: ## Output usage documentation
	@echo "Usage: make COMMAND [args]\n\nCommands:"
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

test: ## Run all tests; Usage: make test [t="<test-folder-1> <test-folder-2> ..."]
	cd tests; \
	./test "$(t)"

build: ## Build all images and push them to Docker Hub
	docker build --no-cache -t phpearth/php:7.0 -f docker/Dockerfile-7.0 docker
	docker build --no-cache -t phpearth/php:7.0-apache -f docker/Dockerfile-7.0-apache docker
	docker build --no-cache -t phpearth/php:7.0-cgi -f docker/Dockerfile-7.0-cgi docker
	docker build --no-cache -t phpearth/php:7.0-cli -f docker/Dockerfile-7.0-cli docker
	docker build --no-cache -t phpearth/php:7.0-litespeed -f docker/Dockerfile-7.0-litespeed docker
	docker build --no-cache -t phpearth/php:7.0-nginx -f docker/Dockerfile-7.0-nginx docker
	docker build --no-cache -t phpearth/php:7.1 -f docker/Dockerfile-7.1 docker
	docker build --no-cache -t phpearth/php:7.1-apache -f docker/Dockerfile-7.1-apache docker
	docker build --no-cache -t phpearth/php:7.1-cgi -f docker/Dockerfile-7.1-cgi docker
	docker build --no-cache -t phpearth/php:7.1-cli -f docker/Dockerfile-7.1-cli docker
	docker build --no-cache -t phpearth/php:7.1-litespeed -f docker/Dockerfile-7.1-litespeed docker
	docker build --no-cache -t phpearth/php:7.1-nginx -f docker/Dockerfile-7.1-nginx docker
	docker build --no-cache -t phpearth/php:7.2 -f docker/Dockerfile-7.2 docker
	docker build --no-cache -t phpearth/php:7.2-apache -f docker/Dockerfile-7.2-apache docker
	docker build --no-cache -t phpearth/php:7.2-cgi -f docker/Dockerfile-7.2-cgi docker
	docker build --no-cache -t phpearth/php:7.2-cli -f docker/Dockerfile-7.2-cli docker
	docker build --no-cache -t phpearth/php:7.2-litespeed -f docker/Dockerfile-7.2-litespeed docker
	docker build --no-cache -t phpearth/php:7.2-nginx -f docker/Dockerfile-7.2-nginx docker
	docker push phpearth/php:7.0
	docker push phpearth/php:7.0-apache
	docker push phpearth/php:7.0-cgi
	docker push phpearth/php:7.0-cli
	docker push phpearth/php:7.0-litespeed
	docker push phpearth/php:7.0-nginx
	docker push phpearth/php:7.1
	docker push phpearth/php:7.1-apache
	docker push phpearth/php:7.1-cgi
	docker push phpearth/php:7.1-cli
	docker push phpearth/php:7.1-litespeed
	docker push phpearth/php:7.1-nginx
	docker push phpearth/php:7.2
	docker push phpearth/php:7.2-apache
	docker push phpearth/php:7.2-cgi
	docker push phpearth/php:7.2-cli
	docker push phpearth/php:7.2-litespeed
	docker push phpearth/php:7.2-nginx
	docker tag phpearth/php:7.2 phpearth/php:latest
	docker push phpearth/php:latest<commit_msg>Add build args to Makefile when building images<commit_after>.PHONY: help test build build-all push-all build-and-push
.DEFAULT_GOAL := help

help: ## Output usage documentation
	@echo "Usage: make COMMAND [args]\n\nCommands:"
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

test: ## Run all tests; Usage: make test [t="<test-folder-1> <test-folder-2> ..."]
	cd tests; \
	./test "$(t)"

build: ## Build image. Usage: make build TAG="7.0-cli"
	docker build --no-cache --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` -t phpearth/php:$(TAG) -f docker/Dockerfile-$(TAG) docker

build-all: ## Build all images
	make build TAG="7.0"
	make build TAG="7.0-apache"
	make build TAG="7.0-cgi"
	make build TAG="7.0-cli"
	make build TAG="7.0-litespeed"
	make build TAG="7.0-nginx"
	make build TAG="7.1"
	make build TAG="7.1-apache"
	make build TAG="7.1-cgi"
	make build TAG="7.1-cli"
	make build TAG="7.1-litespeed"
	make build TAG="7.1-nginx"
	make build TAG="7.2"
	make build TAG="7.2-apache"
	make build TAG="7.2-cgi"
	make build TAG="7.2-cli"
	make build TAG="7.2-litespeed"
	make build TAG="7.2-nginx"

push-all: ## Push all built images to Docker Hub
	docker push phpearth/php:7.0
	docker push phpearth/php:7.0-apache
	docker push phpearth/php:7.0-cgi
	docker push phpearth/php:7.0-cli
	docker push phpearth/php:7.0-litespeed
	docker push phpearth/php:7.0-nginx
	docker push phpearth/php:7.1
	docker push phpearth/php:7.1-apache
	docker push phpearth/php:7.1-cgi
	docker push phpearth/php:7.1-cli
	docker push phpearth/php:7.1-litespeed
	docker push phpearth/php:7.1-nginx
	docker push phpearth/php:7.2
	docker push phpearth/php:7.2-apache
	docker push phpearth/php:7.2-cgi
	docker push phpearth/php:7.2-cli
	docker push phpearth/php:7.2-litespeed
	docker push phpearth/php:7.2-nginx
	docker tag phpearth/php:7.2 phpearth/php:latest
	docker push phpearth/php:latest

build-and-push: ## Build all images and push them to Docker Hub
	make build-all
	make push-all
{'fraction_non_alphanumeric': 0.15636588380716934, 'fraction_numerical': 0.04449938195302843, 'mean_word_length': 3.7135922330097086, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1472745', 'n_tokens_mistral': 2146, 'n_tokens_neox': 1991, 'n_words': 471}