11version : ' 3'
22
3- dotenv : [".task. env", ".env"]
3+ dotenv : [".env.task ", ".env"]
44
55tasks :
66 template-prune :
7- name : Prune installation
87 desc : Update the repository's files to match current project name
98 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
9+ # Modify contents of settings.local.yml and create .env file.
10+ - PROJECTNAME={{.PROJECTNAME}} ./deploy-templates/scripts/modifyFilesContent.sh
11+
12+ # Add docker setup
13+ - task docker:install
14+
2415 # Move Drupal configuration files into place.
2516 - mkdir -p web/sites/default
2617 - mv deploy-templates/{settings.local.php,services.local.yml} web/sites/default/
18+
19+ # Set the actual project name in select files (Sed command different between mac and linux).
20+ - task rename
21+
22+ # Remove build scripts
23+ - rm -Rf deploy-templates/scripts
24+
2725 # Move the rest of the files "here"
2826 - mv deploy-templates/* .
29- # Set the actual project name in select files.
30- - sed -i '' -e 's/{PROJECTNAME}/{{.PROJECTNAME}}/g' README.md CHANGELOG.md
27+ # Remove deploy templates
3128 - rmdir deploy-templates
3229 # Remove workflows that make sense only in the template project
3330 - rm .github/workflows/template_*.yml
34-
3531 requires :
3632 vars :
3733 - PROJECTNAME
@@ -41,7 +37,12 @@ tasks:
4137 msg : " PROJECTNAME should only contain lowercase a-z, digits and hyphens"
4238
4339 docker:install :
44- name : Install ITKDev docker compose
4540 desc : Install docker compose templates (to get the newest version)
4641 cmds :
47- - itkdev-docker-compose template:install drupal-10 --force
42+ - itkdev-docker-compose template:install drupal-11 --force
43+
44+ rename :
45+ desc : Sed command fails in github actions, so we require darwin platform to avoid. @todo better approach.
46+ cmds :
47+ - docker run --rm --volume=$PWD:/app itkdev/php8.3-fpm:latest sed -i -e 's/{PROJECTNAME}/{{.PROJECTNAME}}/g' README.md CHANGELOG.md
48+ platforms : ['darwin']
0 commit comments