-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
48 lines (38 loc) · 1.61 KB
/
Taskfile.yml
File metadata and controls
48 lines (38 loc) · 1.61 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
version: '3'
dotenv: [".env.task", ".env"]
tasks:
template-prune:
desc: Update the repository's files to match current project name
cmds:
# Modify contents of settings.local.yml and create .env file.
- PROJECTNAME={{.PROJECTNAME}} ./deploy-templates/scripts/modifyFilesContent.sh
# Add docker setup
- task docker:install
# Move Drupal configuration files into place.
- mkdir -p web/sites/default
- mv deploy-templates/{settings.local.php,services.local.yml} web/sites/default/
# Set the actual project name in select files (Sed command different between mac and linux).
- task rename
# Remove build scripts
- rm -Rf deploy-templates/scripts
# Move the rest of the files "here"
- mv deploy-templates/* .
# Remove deploy templates
- 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"
docker:install:
desc: Install docker compose templates (to get the newest version)
cmds:
- itkdev-docker-compose template:install drupal-11 --force
rename:
desc: Sed command fails in github actions, so we require darwin platform to avoid. @todo better approach.
cmds:
- docker run --rm --volume=$PWD:/app itkdev/php8.3-fpm:latest sed -i -e 's/{PROJECTNAME}/{{.PROJECTNAME}}/g' README.md CHANGELOG.md
platforms: ['darwin']