phpro / grumphp

A PHP code-quality tool
MIT License
4.11k stars 429 forks source link

how can I use grum with docker-compose ? #1109

Closed rivassh closed 9 months ago

rivassh commented 9 months ago

when I change execute to docker-compose, it doesn't work: Snapshot_2023-09-16_11-04-52

# grumphp.yml
grumphp:
  git_hook_variables:
    EXEC_GRUMPHP_COMMAND: [ '/usr/bin/docker-compose', 'exec', 'app', 'sh' ]
veewee commented 9 months ago

Does the container have php installed? Instead of 'sh', you might need to use 'php' ?

oallain commented 9 months ago

Hello,

I can use :

grumphp:
    git_hook_variables:
        EXEC_GRUMPHP_COMMAND: docker exec -i -u DOCKER_USER -w PROJECT_DIR php

Where :

⚠️ After changing this value on grumphp.yaml you must launch command vendor/bin/grumphp configure to rewrite file .git/hooks/pre-commit

Hope it will help you.

Regards

veewee commented 9 months ago

I consider this one answered. Feel free to reopen if not.