Skip to content

Commit

Permalink
feat(task runners): added a versions task which outputs versions of a…
Browse files Browse the repository at this point in the history
…ll stack
  • Loading branch information
COil committed Oct 21, 2023
1 parent db0ae2c commit d50e959
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ ci: ## Run CI locally
ci: test cs lint


## —— Other tools and helpers 🔨 ———————————————————————————————————————————————
versions: ## Output current stack versions
@echo '—— PHP ————————————————————————————————————————————————————————————'
@php -v
@echo '\n—— Composer ———————————————————————————————————————————————————————'
@composer --version
@echo '\n—— Symfony ————————————————————————————————————————————————————————'
@bin/console --version
@echo '\n—— PHPUnit (simple-phpunit) ———————————————————————————————————————'
@vendor/bin/simple-phpunit --version
@echo '—— PHPStan ————————————————————————————————————————————————————————'
@vendor/bin/phpstan --version
@echo '\n—— php-cs-fixer ———————————————————————————————————————————————————'
@vendor/bin/php-cs-fixer --version
@echo


## —— Deploy & Prod 🚀 —————————————————————————————————————————————————————————
deploy: ## Simple manual deploy on VPS (this is to update the demo site https://microsymfony.ovh/)
@git pull
Expand Down
30 changes: 30 additions & 0 deletions castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,33 @@ function ci(): void
cs_all();
lint_all();
}

#[AsTask(name: 'versions', namespace: 'helpers', description: 'Output current stack versions')]
function versions(): void
{
title(__FUNCTION__, get_command());
io()->note('PHP');
run('php -v', quiet: false);
io()->newLine();

io()->note('Composer');
run('composer --version', quiet: false);
io()->newLine();

io()->note('Symfony');
run('bin/console --version', quiet: false);
io()->newLine();

io()->note('PHPUnit (with simple-phpunit)');
run('vendor/bin/simple-phpunit --version', quiet: false);

io()->note('PHPStan');
run('vendor/bin/phpstan --version', quiet: false);
io()->newLine();

io()->note('php-cs-fixer');
run('vendor/bin/php-cs-fixer --version', quiet: false);
io()->newLine();

success();
}

0 comments on commit d50e959

Please sign in to comment.