From ee2adaf938fc855cfe2ffed20d746ea69c64a9e2 Mon Sep 17 00:00:00 2001 From: Benoit Foujols Date: Tue, 2 May 2023 11:05:52 +0200 Subject: [PATCH] add taskfile #3 --- TaskFile.yaml | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 TaskFile.yaml diff --git a/TaskFile.yaml b/TaskFile.yaml new file mode 100644 index 0000000..5807aa4 --- /dev/null +++ b/TaskFile.yaml @@ -0,0 +1,133 @@ +# _____ _ __ _ _ +# |_ _|_ _ ___| | __/ _(_) | ___ +# | |/ _` / __| |/ / |_| | |/ _ \ +# | | (_| \__ \ <| _| | | __/ +# |_|\__,_|___/_|\_\_| |_|_|\___| +# +# https://taskfile.dev +# + +version: '3' + +silent: true + +## +## === Variables ================================================== +## + +vars: + # + # TASKFILE + CONTRIBUTOR: "Benoit Foujols" + ENV: main + # + # SYSTEM + PWD: $PWD + # + # DOCKER + DOCKER: docker + DOCKER_FILE: docker-compose.yml + DOCKER_RUN: "{{.DOCKER}} run" + DOCKER_COMPOSE: "{{.DOCKER}} compose" + # + # COMPOSER + COMPOSER: composer + # + # PHP UNIT TOOLS + PHPUNIT: "php vendor/bin/phpunit" + + +## +## === TASKS ================================================== +## + +tasks: + default: + cmds: + - task: help + + ## === πŸ†˜ HELP ================================================== + + help: + desc: "Description des tΓ’ches disponibles" + cmds: + - echo " "; + - echo " πŸ“¦ YOUR SYSTEM ---------------------------------------------------------" + - echo "Version {{.VERSION}}" + - echo 'Your system "{{OS}}" / "{{ARCH}}"' + - echo " "; + - echo " πŸ“¦ ESSENTIAL TASK ---------------------------------------------------------" + - echo "* start Start project exemple" + - echo "* stop Stop project exemple" + - echo " "; + - echo " πŸŽ›οΈ OTHER TASK ----------------------------------------------------------" + - task --list + + ## === πŸ‹ DOCKER ================================================ + + docker-up: + desc: "Start docker containers" + cmds: + - "{{.DOCKER_COMPOSE}} up -d" + + docker-stop: + desc: "Stop docker containers" + cmds: + - "{{.DOCKER_COMPOSE}} stop" + + docker-down: + desc: "Stop and remove docker containers, networks.." + cmds: + - "{{.DOCKER_COMPOSE}} down" + + docker-reset: + desc: "Stop and reset on your environment" + cmds: + - "{{.DOCKER_COMPOSE}} down -v" + + ## === πŸ“¦ COMPOSER ============================================== + + composer-install: + desc: "Install composer dependencies" + cmds: + - "{{.COMPOSER}} install" + + composer-update: + desc: "Update composer dependencies" + cmds: + - "{{.COMPOSER}} update" + + composer-validate: + desc: Validate composer.json file. + cmds: + - "{{.COMPOSER}} validate" + + composer-validate-deep: + desc: Validate composer.json and composer.lock files in strict mode. + cmds: + - "{{.COMPOSER}} validate --strict --check-lock" + + ## === πŸ”Ž TESTS ================================================= + + tests: + desc: "Run tests" + cmds: + - "{{.PHPUNIT}} --testdox" + + tests-coverage: + desc: "Run tests with coverage" + cmds: + - "{{.PHPUNIT}} --testdox tests --coverage-clover clover.xml" + + ## === ⭐ OTHERS ================================================= + + before-commit: + desc: "Run before commit" + cmds: + - task: tests + + start: + desc: "Start project exemple" + cmds: + - | + Composer start \ No newline at end of file