docker-example-drupal/justfile

69 lines
1.3 KiB
Makefile
Raw Normal View History

2023-05-09 20:32:29 +00:00
# Do not edit this file. It is automatically generated by https://oliverdavies.dev/build-configs.
2023-03-14 20:20:48 +00:00
2023-02-21 08:18:55 +00:00
default:
@just --list
2023-04-24 19:28:00 +00:00
# Start the project
start:
cp -v --no-clobber .env.example .env
docker compose up -d
# Stop the project
stop:
docker compose down
2023-02-21 08:18:55 +00:00
composer *args:
just _exec php composer {{ args }}
2023-04-12 21:22:51 +00:00
alias phpunit := test
test *args:
2023-05-09 19:31:26 +00:00
just _exec php phpunit --colors=always {{ args }}
2023-04-12 21:22:51 +00:00
2023-02-21 08:18:55 +00:00
drush *args:
just _exec php drush {{ args }}
2023-03-14 20:20:48 +00:00
install *args:
just _exec php drush site:install -y {{ args }}
# Enable or disable Git hooks
git-hooks command:
#!/usr/bin/env bash
set -euo pipefail
case "{{ command }}" in
"on")
echo "Enabling Git hooks..."
git config core.hooksPath .githooks
;;
"off")
echo "Disabling Git hooks..."
git config --unset core.hooksPath
;;
*)
echo "Error: Invalid argument. Must be either 'on' or 'off'"
;;
esac
test-commit:
just _run php phpcs
just _run php phpstan analyze --no-progress --memory-limit=512M
just test --testdox --testsuite unit
just test --testdox --testsuite kernel
2023-04-24 22:00:49 +00:00
2023-02-21 08:18:55 +00:00
_exec +args:
docker compose exec {{ args }}
2023-04-12 21:22:51 +00:00
2023-04-12 21:40:14 +00:00
_run service command *args:
2023-04-12 21:46:30 +00:00
docker compose run \
--entrypoint {{ command }} \
--no-deps \
--rm \
2023-04-21 10:57:36 +00:00
-T \
2023-04-12 21:46:30 +00:00
{{ service }} {{ args }}
2023-04-24 19:28:00 +00:00
# vim: ft=just