-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
40 lines (35 loc) · 1.34 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
version: '3'
dotenv: [".task.env", ".env"]
tasks:
template-prune:
cmds:
- |
cat <<'EOF' > .env
COMPOSE_PROJECT_NAME={{.PROJECTNAME}}
COMPOSE_DOMAIN={{.PROJECTNAME}}.local.itkdev.dk
EOF
- rm -R web/themes/custom/TEMPLATE_THEME
- |
cat <<'EOF' >> deploy-templates/settings.local.php
/**
* Set trusted host pattern.
*/
$settings['trusted_host_patterns'][] = '^{{.PROJECTNAME}}\.local\.itkdev\.dk$';
EOF
# Move Drupal configuration files into place.
- mkdir -p web/sites/default
- mv deploy-templates/{settings.local.php,services.local.yml} web/sites/default/
# Move the rest of the files "here"
- mv deploy-templates/* .
# Set the actual project name in select files.
# https://github.com/cicirello/gnu-on-alpine
- docker run --rm --volume "${PWD}:/app" --workdir /app cicirello/gnu-on-alpine sed -i'' -e 's/{PROJECTNAME}/{{.PROJECTNAME}}/g' README.md CHANGELOG.md
- rmdir deploy-templates
# Remove workflows that make sense only in the template project
- rm .github/workflows/template_*.yml
requires:
vars:
- PROJECTNAME
preconditions:
- sh: "[[ {{.PROJECTNAME}} =~ ^[a-z0-9\\-]+$ ]]"
msg: "PROJECTNAME should only contain lowercase a-z, digits and hyphens"