|
| 1 | +dockerCompose := "docker compose" |
| 2 | +dockerExec := dockerCompose + " exec php" |
| 3 | +defaultPhp := "7.4" |
| 4 | + |
| 5 | +default: |
| 6 | + @just --list --justfile {{ justfile() }} |
| 7 | + |
| 8 | +# Build the docker image with the given PHP version |
| 9 | +build version=defaultPhp *options="": |
| 10 | + {{ dockerCompose }} build --build-arg=PHP_VERSION={{ version }} {{ options }} |
| 11 | + |
| 12 | +# Build the docker image (and pull new images) with the given PHP version |
| 13 | +build-pull version=defaultPhp: (build version "--pull") |
| 14 | + |
| 15 | +# Build the docker image (and pull new images, with no docker cache) with the given PHP version |
| 16 | +rebuild version=defaultPhp: (build version "--pull" "--no-cache") |
| 17 | + |
| 18 | +# Start the docker containers in detached mode (no logs) and waits for the dependencies to be up and running. |
| 19 | +up: |
| 20 | + {{ dockerCompose }} up --detach --wait |
| 21 | + |
| 22 | +# Start the docker containers and keep the daemon attached |
| 23 | +up-foreground: |
| 24 | + {{ dockerCompose }} up |
| 25 | + |
| 26 | +# Stop the running containers |
| 27 | +down: |
| 28 | + {{ dockerCompose }} down --remove-orphans |
| 29 | + |
| 30 | +# Display and follow the containers logs |
| 31 | +logs: |
| 32 | + {{ dockerCompose }} logs --follow |
| 33 | + |
| 34 | +# Get a terminal within the running PHP container |
| 35 | +shell: |
| 36 | + {{ dockerExec }} ash |
| 37 | + |
| 38 | +cs-check: (run-cs-fix "--dry-run") |
| 39 | +cs-fix: run-cs-fix |
| 40 | +[private] |
| 41 | +run-cs-fix *options: |
| 42 | + {{ dockerExec }} tools/php-cs-fixer.phar fix --verbose {{ options }} |
| 43 | + |
| 44 | +# Run the legacy Symfony1 tests on the currently running docker instance |
| 45 | +tests-legacy: |
| 46 | + {{ dockerExec }} php data/bin/symfony symfony:test --trace |
| 47 | + |
| 48 | +# Setup and initialize the project (docker image must be running) |
| 49 | +setup: |
| 50 | + git submodule update --checkout --recursive --force |
| 51 | + {{ dockerExec }} composer update --optimize-autoloader |
| 52 | + |
| 53 | +# Cleanup the local code from vendor and composer.lock file |
| 54 | +cleanup: |
| 55 | + rm -fr vendor/ |
| 56 | + rm -fr composer.lock |
0 commit comments