2023-03-08 21:13:28 +00:00
|
|
|
# {{ managedText | raw }}
|
|
|
|
|
2023-06-27 12:29:10 +00:00
|
|
|
{% set isFlake = flake is defined %}
|
|
|
|
|
2023-02-21 08:29:09 +00:00
|
|
|
default:
|
|
|
|
@just --list
|
|
|
|
|
2023-04-24 19:26:34 +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:29:09 +00:00
|
|
|
{% if "php" is same as language %}
|
|
|
|
composer *args:
|
|
|
|
{{ "just _exec php composer {{ args }}" | raw }}
|
2023-04-12 21:21:43 +00:00
|
|
|
|
|
|
|
alias phpunit := test
|
|
|
|
|
|
|
|
test *args:
|
2023-05-09 19:24:21 +00:00
|
|
|
{% if "drupal-project" is same as type %}
|
|
|
|
{{ "just _exec php phpunit --colors=always {{ args }}" | raw }}
|
|
|
|
{% else %}
|
2023-04-24 21:54:34 +00:00
|
|
|
{{ "just _run php phpunit --colors=always {{ args }}" | raw }}
|
2023-02-21 08:29:09 +00:00
|
|
|
{% endif %}
|
2023-05-11 19:50:44 +00:00
|
|
|
|
|
|
|
test-watch *args:
|
|
|
|
nodemon --ext "*" --watch "." --exec "just test {{ args }} || exit 1" --ignore */sites/simpletest
|
2023-05-09 19:24:21 +00:00
|
|
|
{% endif %}
|
2023-02-21 08:29:09 +00:00
|
|
|
|
|
|
|
{% if "drupal-project" is same as type %}
|
|
|
|
drush *args:
|
|
|
|
{{ "just _exec php drush {{ args }}" | raw }}
|
2023-03-08 21:08:56 +00:00
|
|
|
|
|
|
|
install *args:
|
2023-03-10 23:16:11 +00:00
|
|
|
{{ "just _exec php drush site:install -y {{ args }}" | raw }}
|
2023-02-21 08:29:09 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2023-03-12 12:36:59 +00:00
|
|
|
{% if "node" is same as language %}
|
|
|
|
yarn *args:
|
2023-06-27 12:29:10 +00:00
|
|
|
{% if isFlake %}
|
|
|
|
{{ "just _exec yarn {{ args }}" | raw }}
|
|
|
|
{% else %}
|
2023-03-12 12:36:59 +00:00
|
|
|
{{ "just _exec node yarn {{ args }}" | raw }}
|
|
|
|
{% endif %}
|
2023-06-27 12:29:10 +00:00
|
|
|
{% endif %}
|
2023-03-12 12:36:59 +00:00
|
|
|
|
|
|
|
{% if "fractal" is same as type %}
|
|
|
|
fractal *args:
|
|
|
|
{{ "just yarn fractal {{ args }}" | raw }}
|
2023-04-01 10:30:45 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -fr build
|
|
|
|
|
|
|
|
build *args:
|
2023-06-27 12:29:10 +00:00
|
|
|
{{ "just fractal build {{ args }}" | raw }}
|
2023-04-01 10:30:45 +00:00
|
|
|
|
|
|
|
sync: clean build
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
aws s3 sync "build/." s3://"${BUCKET_NAME}" \
|
|
|
|
--acl "public-read" \
|
|
|
|
--cache-control max-age=3600
|
2023-03-12 12:36:59 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2023-03-13 21:18:30 +00:00
|
|
|
{% if "laravel" is same as type %}
|
|
|
|
artisan *args:
|
2023-04-12 21:20:19 +00:00
|
|
|
{{ "just _run artisan {{ args }}" | raw }}
|
2023-03-13 21:18:30 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2023-04-24 21:54:34 +00:00
|
|
|
{% if experimental.runGitHooksBeforePush %}
|
|
|
|
# Enable or disable Git hooks
|
|
|
|
git-hooks command:
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
case "{{ '{{ command }}'|raw }}" 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:
|
|
|
|
{% if "phpcs" in php|keys -%}
|
|
|
|
just _run php phpcs
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
{% if "phpstan" in php|keys -%}
|
|
|
|
just _run php phpstan analyze --no-progress --memory-limit=512M
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
just test --testdox --testsuite unit
|
|
|
|
just test --testdox --testsuite kernel
|
|
|
|
{% endif %}
|
|
|
|
|
2023-02-21 08:29:09 +00:00
|
|
|
_exec +args:
|
2023-06-27 12:29:10 +00:00
|
|
|
{% if flake is defined %}
|
|
|
|
{{ "nix develop --command {{ args }}" | raw }}
|
|
|
|
{% else %}
|
2023-05-11 19:50:44 +00:00
|
|
|
{{ "docker compose exec -T {{ args }}" | raw }}
|
2023-06-27 12:29:10 +00:00
|
|
|
{% endif %}
|
2023-04-12 21:20:19 +00:00
|
|
|
|
2023-06-27 12:29:10 +00:00
|
|
|
{% if flake is not defined %}
|
2023-04-12 21:36:27 +00:00
|
|
|
_run service command *args:
|
2023-04-12 21:45:56 +00:00
|
|
|
docker compose run \
|
|
|
|
--entrypoint {{ "{{ command }}"|raw }} \
|
|
|
|
--no-deps \
|
|
|
|
--rm \
|
2023-04-21 00:39:03 +00:00
|
|
|
-T \
|
2023-04-12 21:45:56 +00:00
|
|
|
{{ "{{ service }} {{ args }}"|raw }}
|
2023-06-27 12:29:10 +00:00
|
|
|
{% endif %}
|
2023-04-24 21:54:34 +00:00
|
|
|
|
|
|
|
# vim: ft=just
|