-
Notifications
You must be signed in to change notification settings - Fork 9
/
run
executable file
·46 lines (33 loc) · 1.25 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env sh
set -e
url="https://raw.githubusercontent.com/webuni/shell-task-runner/master/runner"
[ -f ./.runner ] || wget -q "$url" -O- > .runner || curl -fso .runner "$url"
. ./.runner
! mkdir -p ~/.composer/cache
if [ ! -f ~/.composer/auth.json ]; then echo "{}" > ~/.composer/auth.json; fi
_decorator()( _decorator_docker_compose_run "$@" )
symfony()( [ -n "$1" ] && echo "--with" "symfony/yaml:$1" || echo "" )
# Update dependencies to the latest versions
task_deps__latest()( _run composer update $(symfony "$1"))
# Update dependencies to the lowest versions
task_deps__lowest()( _run composer update --prefer-lowest $(symfony "$1"))
# Run composer
# @service php
task_composer()( composer "$@" )
# Run composer
# @service php
task_composer__normalize()( composer normalize "$@" )
# Run tests
# @service php
task_tests()( phpunit --colors=always "$@" )
# Fix code style
# @service php
task_cs()( php-cs-fixer fix --ansi --allow-risky=yes "$@" )
# Analyse code
# @service php
task_analyse()( phpstan analyse --no-progress --ansi; __fn psalm && psalm || echo '' )
# Remove all containers in project (use -v to remove volumes also)
task_clean()( _docker_compose down --remove-orphans "$@" )
# Run shell with tools
# @service php
task_tools()( sh "$@" )