<commit_before># Might want to add "--no-cache" to this
DBUILD_FLAGS=
DBUILD=docker build $(DBUILD_FLAGS)
PROJECT?=$(notdir $(CURDIR))

DOCKERFILE=$(wildcard Dockerfile)

TAG=latest

IMAGES=$(foreach x,$(wildcard */Dockerfile),$(patsubst %/,%,$(dir $(STATE)/$x)).built) $(if $(DOCKERFILE),$(STATE)/$(PROJECT).built)

all:: $(IMAGES)

$(STATE)/%.built: %/*
	$(DBUILD) -t $*:$(TAG) $*
	touch $@

ifdef DOCKERFILE
$(STATE)/$(notdir $(CURDIR)).built: Dockerfile 
	$(DBUILD) -t $(PROJECT):$(TAG) .
	touch $@
endif


info::
	@echo IMAGES=$(IMAGES)
	@echo DOCKERFILE=$(DOCKERFILE)
	@echo PROJECT=$(PROJECT)

<commit_msg>Improved state handling and prefixes.<commit_after># Might want to add "--no-cache" to this
DBUILD_FLAGS=
DBUILD=docker build $(DBUILD_FLAGS)
IMAGE_PREFIX?=$(USER)-sandbox-
DOCKERFILE=$(wildcard Dockerfile)

# In the future, we might want to run production off of a "release" branch
TAG=latest

IMAGES=$(foreach x,$(wildcard */Dockerfile),$(STATE)/$(IMAGE_PREFIX)$(patsubst %/,%,$(dir $x)).built) $(if $(DOCKERFILE),$(STATE)/$(IMAGE_PREFIX)$(notdir $(CURDIR)).built)

all:: $(IMAGES)

$(STATE)/$(IMAGE_PREFIX)%.built: %/*
	$(DBUILD) -t $(notdir $(basename $@)):$(TAG) $*
	touch $@

ifdef DOCKERFILE
$(STATE)/$(IMAGE_PREFIX)$(notdir $(CURDIR)).built: Dockerfile 
	$(DBUILD) -t $(notdir $(basename $@)):$(TAG) .
	touch $@
endif


info::
	@echo IMAGES=$(IMAGES)
	@echo DOCKERFILE=$(DOCKERFILE)


{'fraction_non_alphanumeric': 0.2199288256227758, 'fraction_numerical': 0.0, 'mean_word_length': 6.137055837563452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '70195', 'n_tokens_mistral': 546, 'n_tokens_neox': 522, 'n_words': 116}