<commit_before>BOX_VERSION ?= $(shell cat VERSION)
BOX_PREFIX ?= django
BOX_PATH := boxes/$(BOX_PREFIX)-$(BOX_VERSION).box
S3_PREFIX ?= s3://transcode-vagrantcloud/virtualbox
S3_PATH := $(S3_PREFIX)/$(BOX_PREFIX)-$(BOX_VERSION).box
VAGRANT_ID_PATH := .vagrant/machines/default/virtualbox/id
VENV := .venv
AWSCLI := $(VENV)/bin/aws
PIP_INSTALL := $(VENV)/bin/python3 -m pip install

.DEFAULT_GOAL := help

.PHONY: help all build clean clean-venv package upload

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

all: clean build package upload ## Build, package and upload the re-usable box

$(VAGRANT_ID_PATH):
	vagrant up
	cat cleanup.log

build: $(VAGRANT_ID_PATH) ## Create, configure and provision the Vagrant box

clean: ## Destroy the Vagrant box and delete the re-usable box
	vagrant destroy -f
	rm -f $(BOX_PATH)
	rm -r cleanup.log

clean-venv: ## Delete the Python virtual environment
	rm -f $(VENV)

$(BOX_PATH):
	vagrant package --vagrantfile Vagrantfile.package --output $(BOX_PATH)

package: $(BOX_PATH) ## Package the currently running VirtualBox environment into a re-usable box
	ls -hl $(BOX_PATH)

$(VENV):
	python3 -m venv $(VENV)
	$(PIP_INSTALL) --upgrade pip setuptools wheel

$(AWSCLI): $(VENV)
	$(PIP_INSTALL) awscli

upload: $(AWSCLI) ## Upload the re-usable box to a Amazon S3 bucket
	$(AWSCLI) s3 cp $(BOX_PATH) $(S3_PATH)
	$(AWSCLI) s3 ls $(S3_PREFIX)/<commit_msg>Makefile: Fixed rm options<commit_after>BOX_VERSION ?= $(shell cat VERSION)
BOX_PREFIX ?= django
BOX_PATH := boxes/$(BOX_PREFIX)-$(BOX_VERSION).box
S3_PREFIX ?= s3://transcode-vagrantcloud/virtualbox
S3_PATH := $(S3_PREFIX)/$(BOX_PREFIX)-$(BOX_VERSION).box
VAGRANT_ID_PATH := .vagrant/machines/default/virtualbox/id
VENV := .venv
AWSCLI := $(VENV)/bin/aws
PIP_INSTALL := $(VENV)/bin/python3 -m pip install

.DEFAULT_GOAL := help

.PHONY: help all build clean clean-venv package upload

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

all: clean build package upload ## Build, package and upload the re-usable box

$(VAGRANT_ID_PATH):
	vagrant up
	cat cleanup.log

build: $(VAGRANT_ID_PATH) ## Create, configure and provision the Vagrant box

clean: ## Destroy the Vagrant box and delete the re-usable box
	vagrant destroy -f
	rm -f $(BOX_PATH)
	rm -f cleanup.log

clean-venv: ## Delete the Python virtual environment
	rm -rf $(VENV)

$(BOX_PATH):
	vagrant package --vagrantfile Vagrantfile.package --output $(BOX_PATH)

package: $(BOX_PATH) ## Package the currently running VirtualBox environment into a re-usable box
	ls -hl $(BOX_PATH)

$(VENV):
	python3 -m venv $(VENV)
	$(PIP_INSTALL) --upgrade pip setuptools wheel

$(AWSCLI): $(VENV)
	$(PIP_INSTALL) awscli

upload: $(AWSCLI) ## Upload the re-usable box to a Amazon S3 bucket
	$(AWSCLI) s3 cp $(BOX_PATH) $(S3_PATH)
	$(AWSCLI) s3 ls $(S3_PREFIX)/
{'fraction_non_alphanumeric': 0.16020066889632106, 'fraction_numerical': 0.016053511705685617, 'mean_word_length': 4.643396226415095, 'pattern_counts': {'":': 2, '<': 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': '7597344', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1147, 'n_words': 316}