generated from itk-dev/itk-base-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
139 lines (118 loc) · 4.48 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: '3'
dotenv: [".env", ".env.local"]
vars:
# https://taskfile.dev/reference/templating/
SITE_DOMAIN: '{{.TASK_SITE_DOMAIN | default .COMPOSE_SERVER_DOMAIN | default .COMPOSE_DOMAIN | default ""}}'
COMPOSER_INSTALL_ARGUMENTS: '{{ .TASK_COMPOSER_INSTALL_ARGUMENTS | default "" }}'
DOCKER_COMPOSE: '{{ .TASK_DOCKER_COMPOSE | default "docker compose" }}'
tasks:
default:
cmds:
- task --list
silent: true
compose:
desc: "Run `docker compose` command. Example: task compose -- up --detach"
cmds:
- '{{ .DOCKER_COMPOSE }} {{ .CLI_ARGS }}'
compose-exec:
desc: "Run `docker compose exec` command handling content on stdin. Example: task compose-exec -- phpfpm php -v"
cmds:
# Check if we have content on stdin (cf.
# https://unix.stackexchange.com/questions/762992/bash-check-if-the-standard-input-contains-anything)
- if [[ ! -t 0 ]]; then task compose -- exec --no-TTY {{ .CLI_ARGS }}; else task compose -- exec {{ .CLI_ARGS }}; fi
silent: true
composer:
desc: "Run composer command. Example: task composer -- install"
cmds:
- task compose -- exec phpfpm composer {{ .CLI_ARGS }}
silent: true
composer-install:
desc: "Run composer install command. Example: task composer-install"
cmds:
- task composer -- install {{ .COMPOSER_INSTALL_ARGUMENTS }}
silent: true
start:
desc: "Start docker compose stuff and install composer stuff"
cmds:
- task compose -- pull
- task compose -- up --detach --remove-orphans --wait
- task composer-install
silent: true
console:
desc: "Run Symfony console command"
cmds:
# See https://serverfault.com/a/935674 for details on the if statement.
- |
if [ -z `docker compose ps -q phpfpm` ] || [ -z `docker ps -q --no-trunc | grep $(docker compose ps -q phpfpm)` ]; then
task compose -- run --rm phpfpm bin/console {{.CLI_ARGS}}
else
task compose-exec -- phpfpm bin/console {{.CLI_ARGS}}
fi
silent: true
site:url:
desc: "Show site URL"
cmds:
- echo {{.URL}}
vars:
URL:
# Compute base URL if not set.
sh: if [ ! -z "{{.SITE_DOMAIN}}" ]; then echo "https://{{.SITE_DOMAIN}}"; else echo "http://$(task compose -- port nginx 8080)"; fi
silent: true
site:update:
desc: "Update site"
prompt: "This will update your setup. Continue?"
cmds:
- task start
- task console -- doctrine:migrations:migrate --no-interaction
- task console -- cache:clear
silent: true
code-analysis:
desc: "Run code analysis"
cmds:
- task composer -- code-analysis
coding-standards:apply:
desc: "Apply coding standards"
cmds:
- docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint '**/*.md' --fix
- task composer -- coding-standards-apply
- task console -- biomejs:check . --write
coding-standards:check:
desc: "Apply coding standards"
cmds:
- task: coding-standards:apply
- docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint '**/*.md'
- task composer -- coding-standards-check
- docker run --volume "$PWD:/code" --rm pipelinecomponents/yamllint yamllint fixtures/
- task console -- biomejs:check .
coding-standards:assets:apply:
desc: "Apply coding standards for assets"
cmds:
- task console -- biomejs:check . --write
coding-standards:assets:check:
desc: "Apply and check coding standards for assets"
cmds:
- task: coding-standards:assets:apply
- task console -- biomejs:check .
coding-standards:markdown:apply:
desc: "Apply coding standards for Markdown"
cmds:
- docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint '**/*.md' --fix
coding-standards:markdown:check:
desc: "Apply and check coding standards for Markdown"
cmds:
- task: coding-standards:markdown:apply
- docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint '**/*.md'
# prettier:
# desc: "Run Prettier on tests source"
# cmds:
# - docker run --rm -v $(pwd):/work tmknom/prettier --write tests
# - docker run --rm -v $(pwd):/work tmknom/prettier --check tests
fixtures:load:
desc: "Load fixtures"
prompt: "This will reset your database. Continue?"
cmds:
- task: site:update
- task console -- hautelook:fixtures:load --no-interaction
update-translations:
cmds:
- task composer -- update-translations