Skip to content

Commit f7e9630

Browse files
committed
Added script and theme build
1 parent fa8f786 commit f7e9630

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

Taskfile.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,8 @@ tasks:
77
name: Prune installation
88
desc: Update the repository's files to match current project name
99
cmds:
10-
- |
11-
cat <<'EOF' > .env
12-
COMPOSE_PROJECT_NAME={{.PROJECTNAME}}
13-
COMPOSE_DOMAIN={{.PROJECTNAME}}.local.itkdev.dk
14-
EOF
15-
- rm -R web/themes/custom/TEMPLATE_THEME
16-
- |
17-
cat <<'EOF' >> deploy-templates/settings.local.php
18-
19-
/**
20-
* Set trusted host pattern.
21-
*/
22-
$settings['trusted_host_patterns'][] = '^{{.PROJECTNAME}}\.local\.itkdev\.dk$';
23-
EOF
10+
# Modify contents of settings.local.yml and create .env file.
11+
- PROJECTNAME={{.PROJECTNAME}} ./deploy-templates/scripts/modifyFilesContent.sh
2412

2513
# Add docker setup
2614
- task docker:install
@@ -33,13 +21,15 @@ tasks:
3321
# Set the actual project name in select files (Sed command different between mac and linux).
3422
- task rename
3523

24+
# Remove build scripts
25+
- rmdir deploy-templates/scripts
26+
3627
# Move the rest of the files "here"
3728
- mv deploy-templates/* .
3829
# Remove deploy templates
3930
- rmdir deploy-templates
4031
# Remove workflows that make sense only in the template project
4132
- rm .github/workflows/template_*.yml
42-
4333
requires:
4434
vars:
4535
- PROJECTNAME

deploy-templates/Taskfile.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ tasks:
2424
build-site:new:
2525
cmds:
2626
- task drush -- site:install minimal -y
27+
- task compose -- run phpfpm php /app/web/core/scripts/drupal generate-theme {{.THEMENAME}} --name="{{.THEMENAME_READABLE}}" --path="themes/custom" --starterkit=starterkit_project_theme
28+
requires:
29+
vars:
30+
- THEMENAME
31+
- THEMENAME_READABLE
32+
33+
preconditions:
34+
- sh: "[[ {{.THEMENAME}} =~ ^[a-z\\_]+$ ]]"
35+
msg: "THEMENAME should only contain lowercase a-z and underscores"
2736

2837
build-site:existing-conf:
2938
cmds:
@@ -38,6 +47,6 @@ tasks:
3847

3948
check-code:
4049
cmds:
41-
- docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md)
50+
- docker run --rm --volume "$PWD:/md" itkdev/markdownlint '**/*.md'
4251
- task composer -- code-analysis
4352
- task composer -- coding-standards-check/twig-cs-fixer
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
file=".env"
4+
echo "COMPOSE_PROJECT_NAME=$PROJECTNAME" > $file
5+
echo "COMPOSE_DOMAIN=$PROJECTNAME.local.itkdev.dk" >> $file
6+
cat $file
7+
8+
file="./deploy-templates/settings.local.php"
9+
echo "" >> $file
10+
echo "/**" >> $file
11+
echo " * Set trusted host pattern." >> $file
12+
echo " */" >> $file
13+
echo "\$settings['trusted_host_patterns'][] = '^$PROJECTNAME\.local\.itkdev\.dk$';" >> $file
14+
cat $file

0 commit comments

Comments
 (0)