|
| 1 | +# https://taskfile.dev |
| 2 | + |
| 3 | +version: "3" |
| 4 | + |
| 5 | +# https://taskfile.dev/usage/#env-files |
| 6 | +dotenv: [".env.local", ".env"] |
| 7 | + |
| 8 | +vars: |
| 9 | + # https://taskfile.dev/reference/templating/ |
| 10 | + DOCKER_COMPOSE: '{{.TASK_DOCKER_COMPOSE | default "docker compose"}}' |
| 11 | + |
| 12 | + # We're not yet ready to normalize config files … |
| 13 | + YAML_FILES_GLOB: "Taskfile.yml .github/workflows/**.{yml,yaml}" |
| 14 | + |
| 15 | +tasks: |
| 16 | + site:update: |
| 17 | + desc: Update/install site |
| 18 | + cmds: |
| 19 | + - task: compose |
| 20 | + vars: |
| 21 | + COMPOSE_ARGS: pull |
| 22 | + - task: compose |
| 23 | + vars: |
| 24 | + COMPOSE_ARGS: up --detach --wait |
| 25 | + - task: composer |
| 26 | + vars: |
| 27 | + COMPOSER_ARGS: install |
| 28 | + |
| 29 | + fixtures:load: |
| 30 | + desc: Load all fixtures |
| 31 | + prompt: Really load all fixtures? |
| 32 | + cmds: |
| 33 | + - for: |
| 34 | + - events |
| 35 | + - organizations |
| 36 | + - occurrences |
| 37 | + - daily_occurrences |
| 38 | + - tags |
| 39 | + - vocabularies |
| 40 | + - locations |
| 41 | + task: compose |
| 42 | + vars: |
| 43 | + COMPOSE_ARGS: exec phpfpm bin/console app:fixtures:load {{.ITEM}} |
| 44 | + # Loading some fixtures generates an 'Warning: Undefined array key "entityId"' error. |
| 45 | + ignore_error: true |
| 46 | + silent: true |
| 47 | + |
| 48 | + api:test: |
| 49 | + desc: Run API tests |
| 50 | + prompt: Make sure to load fixtures before running tests (`task fixtures:load`) |
| 51 | + cmds: |
| 52 | + - task: compose |
| 53 | + vars: |
| 54 | + COMPOSE_ARGS: exec phpfpm bin/phpunit |
| 55 | + |
| 56 | + composer: |
| 57 | + desc: "Run `composer` command. Example: task composer -- normalize" |
| 58 | + cmds: |
| 59 | + - task: compose |
| 60 | + vars: |
| 61 | + COMPOSE_ARGS: exec phpfpm composer {{.COMPOSER_ARGS}} |
| 62 | + |
| 63 | + compose: |
| 64 | + desc: "Run `docker compose` command. Example: task compose -- ps" |
| 65 | + cmds: |
| 66 | + # Run docker compose with both arguments passed via var plus any cli args. |
| 67 | + - "{{.DOCKER_COMPOSE}} {{.COMPOSE_ARGS}} {{.CLI_ARGS}}" |
| 68 | + |
| 69 | + coding-standards:apply: |
| 70 | + desc: "Apply coding standards" |
| 71 | + cmds: |
| 72 | + - task: coding-standards:markdown:apply |
| 73 | + - task: coding-standards:php:apply |
| 74 | + - task: coding-standards:twig:apply |
| 75 | + - task: coding-standards:yaml:apply |
| 76 | + silent: true |
| 77 | + |
| 78 | + coding-standards:check: |
| 79 | + desc: "Apply coding standards" |
| 80 | + cmds: |
| 81 | + - task: coding-standards:markdown:check |
| 82 | + - task: coding-standards:php:check |
| 83 | + - task: coding-standards:twig:check |
| 84 | + - task: coding-standards:yaml:check |
| 85 | + silent: true |
| 86 | + |
| 87 | + coding-standards:markdown:apply: |
| 88 | + desc: "Apply coding standards for Markdown" |
| 89 | + cmds: |
| 90 | + - task: compose |
| 91 | + vars: |
| 92 | + COMPOSE_ARGS: run --rm markdownlint markdownlint '**/*.md' --fix |
| 93 | + |
| 94 | + coding-standards:markdown:check: |
| 95 | + desc: "Apply and check coding standards for Markdown" |
| 96 | + cmds: |
| 97 | + - task: coding-standards:markdown:apply |
| 98 | + - task: compose |
| 99 | + vars: |
| 100 | + COMPOSE_ARGS: run --rm markdownlint markdownlint '**/*.md' |
| 101 | + |
| 102 | + coding-standards:php:apply: |
| 103 | + desc: "Apply coding standards for PHP" |
| 104 | + cmds: |
| 105 | + - task: compose |
| 106 | + vars: |
| 107 | + COMPOSE_ARGS: exec phpfpm vendor/bin/php-cs-fixer fix |
| 108 | + silent: true |
| 109 | + |
| 110 | + coding-standards:php:check: |
| 111 | + desc: "Apply and check coding standards for PHP" |
| 112 | + cmds: |
| 113 | + - task: coding-standards:php:apply |
| 114 | + - task: compose |
| 115 | + vars: |
| 116 | + COMPOSE_ARGS: exec phpfpm vendor/bin/php-cs-fixer check |
| 117 | + silent: true |
| 118 | + |
| 119 | + coding-standards:twig:apply: |
| 120 | + desc: "Apply coding standards for Twig" |
| 121 | + cmds: |
| 122 | + - task: compose |
| 123 | + vars: |
| 124 | + COMPOSE_ARGS: exec phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff |
| 125 | + silent: true |
| 126 | + |
| 127 | + coding-standards:twig:check: |
| 128 | + desc: "Apply and check coding standards for Twig" |
| 129 | + cmds: |
| 130 | + - task: coding-standards:twig:apply |
| 131 | + - task: compose |
| 132 | + vars: |
| 133 | + COMPOSE_ARGS: exec phpfpm vendor/bin/twig-cs-fixer lint |
| 134 | + silent: true |
| 135 | + |
| 136 | + coding-standards:yaml:apply: |
| 137 | + desc: "Apply coding standards for YAML" |
| 138 | + cmds: |
| 139 | + - task: compose |
| 140 | + vars: |
| 141 | + COMPOSE_ARGS: run --rm prettier {{.YAML_FILES_GLOB}} --write |
| 142 | + silent: true |
| 143 | + |
| 144 | + coding-standards:yaml:check: |
| 145 | + desc: "Apply and check coding standards for YAML" |
| 146 | + cmds: |
| 147 | + - task: coding-standards:yaml:apply |
| 148 | + - task: compose |
| 149 | + vars: |
| 150 | + COMPOSE_ARGS: run --rm prettier {{.YAML_FILES_GLOB}} --check |
| 151 | + silent: true |
| 152 | + |
| 153 | + default: |
| 154 | + cmds: |
| 155 | + - task --list |
| 156 | + silent: true |
0 commit comments