Skip to content

Commit ddfaf0a

Browse files
authored
Merge pull request #9 from itk-dev/hotfix/actions
Change task build
2 parents 040f9d5 + 84fb729 commit ddfaf0a

14 files changed

Lines changed: 121 additions & 295 deletions

File tree

.github/workflows/pr.yml

Lines changed: 0 additions & 167 deletions
This file was deleted.

.github/workflows/template_test.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ on:
77
pull_request:
88

99
jobs:
10-
test-prune-project:
10+
changelog:
1111
runs-on: ubuntu-latest
12-
name: Test prune project
13-
env:
14-
PROJECT_NAME: my-test-project
12+
name: Changelog should be updated
1513
steps:
1614
- name: Checkout
1715
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 2
1818

19-
# https://taskfile.dev/installation/#github-actions
20-
- name: Setup Task
21-
uses: arduino/setup-task@v2
19+
- name: Git fetch
20+
run: git fetch
2221

23-
- name: Prune project
24-
run: |
25-
task template-prune PROJECTNAME=$PROJECT_NAME
22+
- name: Check that changelog has been updated.
23+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.markdownlint.jsonc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config/

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning].
77

88
## [Unreleased]
99

10-
* [PR-7](https://github.com/itk-dev/drupal-11-template/pull/7)
11-
Miscellaneous
10+
## [1.0.0]
1211

1312
### Added
1413

1514
* Template files added
1615

16+
### Changed
17+
18+
* [PR-9](https://github.com/itk-dev/drupal-11-template/pull/9)
19+
- Fixed github actions.
20+
* [PR-7](https://github.com/itk-dev/drupal-11-template/pull/7)
21+
- Miscellaneous
22+
1723
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
1824
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
1925
[Unreleased]: https://github.com/itk-dev/drupal-11-template/compare/main...develop

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ Build a new project using this template (replace `{REPO_NAME}` with a proper Git
2222
gh repo create itk-dev/{REPO_NAME} --template itk-dev/drupal-11-template --public --clone
2323
```
2424

25-
Install the newest docker compose setup from [https://github.com/itk-dev/devops_itkdev-docker](https://github.com/itk-dev/devops_itkdev-docker).
26-
27-
```shell
28-
task docker:install
29-
```
30-
3125
### Prune the project
3226

3327
Prune the project to remove/override template specific files and set up the

Taskfile.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
version: '3'
22

3-
dotenv: [".task.env", ".env"]
3+
dotenv: [".env.task", ".env"]
44

55
tasks:
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

Comments
 (0)