-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
114 lines (94 loc) · 3.59 KB
/
Copy pathTaskfile.yml
File metadata and controls
114 lines (94 loc) · 3.59 KB
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
version: '3'
dotenv: [".task.env", ".env"]
vars:
DOCKER_COMPOSE: '{{ .TASK_DOCKER_COMPOSE | default "docker compose" }}'
# https://taskfile.dev/reference/templating/
BASE_URL: '{{.TASK_BASE_URL | default .COMPOSE_SERVER_DOMAIN | default .COMPOSE_DOMAIN | default ""}}'
tasks:
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
console:
desc: "Run console command"
cmds:
- task compose-exec -- phpfpm bin/console {{ .CLI_ARGS }}
start:
desc: "Start docker compose stuff and install composer stuff"
cmds:
- task compose -- pull
- task compose -- up --detach --build --remove-orphans
- task composer -- install
- task run-build
- task migrate
silent: true
start:local:
desc: "Start and apply fixtures"
cmds:
- task start
- task fixtures
silent: true
site-url:
desc: "Show site URL"
cmds:
- echo {{.URL}}
vars:
URL:
# Compute base URL if not set.
sh: if [ ! -z "{{.BASE_URL}}" ]; then echo "https://{{.BASE_URL}}"; else echo "http://$(task compose -- port nginx 8080)"; fi
silent: true
check-code:
desc: "Check coding standards"
cmds:
- task compose -- run --rm node yarn coding-standards-check/markdownlint
- task composer -- validate composer.json --strict
# @todo enable this
# - task composer -- code-analysis
- task composer -- coding-standards-check
coding-standards-apply:
desc: "Apply coding standards"
cmds:
- task composer -- coding-standards-apply
run-dev:
desc: "Build assets"
cmds:
- task compose -- run --rm node yarn run dev
run-watch:
desc: "Build and watch assets"
cmds:
- task compose -- run --rm node yarn run watch
run-build:
desc: "Build assets for production"
cmds:
- task compose -- run --rm node yarn run build
migrate:
desc: "Run migrations with no interaction"
cmds:
- task console -- doctrine:migrations:migrate --no-interaction
fixtures:
desc: "Apply fixtures"
cmds:
- task console -- hautelook:fixtures:load --no-bundles --purge-with-truncate --no-interaction
login:
desc: "Get login url for user with email. Example: task login -- admin@example.com"
requires:
vars: [ CLI_ARGS ]
cmds:
- task console -- itk-dev:openid-connect:login {{.CLI_ARGS}}
update:translations:
desc: "Update translations"
cmds:
- task compose-exec -- phpfpm composer update-translations
- task compose-exec -- phpfpm bin/console cache:clear