<commit_before>.PHONY: init
init: .env upd install back/var/oauth2/public.key init-db create-default-client down

.PHONY: build
build:
	docker-compose build --parallel

.PHONY: upd
upd: build
	docker-compose up -d

.PHONY: up
up: build
	docker-compose up

.PHONY: down
down:
	docker-compose down

.env:
	cp .env.dist .env

.PHONY: install
install:
	docker-compose exec php composer install
	cd front && npm install

.PHONY: init-db
init-db: install
	docker-compose exec php bin/console doctrine:schema:create; true

.PHONY: create-default-client
create-default-client: init-db
	docker-compose exec php bin/console trikoder:oauth2:create-client default "" --scope superadmin --grant-type client_credentials; true

back/var/oauth2/private.key:
	docker-compose exec php mkdir -p var/oauth2
	docker-compose exec php openssl genrsa -out var/oauth2/private.key 2048

back/var/oauth2/public.key: back/var/oauth2/private.key
	docker-compose exec php openssl rsa -in var/oauth2/private.key -pubout -out var/oauth2/public.key<commit_msg>chore: add help make command and comment Makefile<commit_after>.PHONY: help
help:
	@printf "\033[33mUsage:\033[0m\n  make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
	@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[32m%-15s\033[0m %s\n", $$1, $$2}'

.PHONY: init
init: .env upd install back/var/oauth2/public.key init-db create-default-client down ## Initialize project dependencies, database, keys, etc.

.PHONY: build
build:
	docker-compose build --parallel

.PHONY: upd
upd: build
	docker-compose up -d

.PHONY: up
up: build ## Launch the app
	docker-compose up

.PHONY: down
down: ## Stop the app
	docker-compose down

.env:
	cp .env.dist .env

.PHONY: install
install: ## Install back and front dependencies
	docker-compose exec php composer install
	cd front && npm install

.PHONY: init-db
init-db: install
	docker-compose exec php bin/console doctrine:schema:create; true

.PHONY: create-default-client
create-default-client: init-db
	docker-compose exec php bin/console trikoder:oauth2:create-client default "" --scope superadmin --grant-type client_credentials; true

back/var/oauth2/private.key:
	docker-compose exec php mkdir -p var/oauth2
	docker-compose exec php openssl genrsa -out var/oauth2/private.key 2048

back/var/oauth2/public.key: back/var/oauth2/private.key
	docker-compose exec php openssl rsa -in var/oauth2/private.key -pubout -out var/oauth2/public.key
{'fraction_non_alphanumeric': 0.12959224868792896, 'fraction_numerical': 0.023819136051675415, 'mean_word_length': 4.04684317718941, 'pattern_counts': {'":': 1, '<': 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': '3118001', 'n_tokens_mistral': 986, 'n_tokens_neox': 918, 'n_words': 247}