diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 00000000..5dfad4d3 --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,93 @@ +on: pull_request + +name: Review + +env: + COMPOSE_USER: runner + +jobs: + check-github-actions-documentation: + runs-on: ubuntu-latest + name: Check that Github Actions documentation is up to date + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + # https://github.com/arduino/setup-task/tree/56d0cc033e3cecc5f07a291fdd39f29388d21800?tab=readme-ov-file#repo-token + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + # https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug + # Enable tmate debugging if debug logging is enabled (cf. + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context) + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: 1 == runner.debug + + - run: | + task github-actions:documentation:update + + # Check that documentation has not changed. + - run: | + task github-actions:documentation:diff + + check-github-actions-template-headers: + runs-on: ubuntu-latest + name: Check that Github Actions template headers are up to date + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: | + task github-actions:template-headers:update --yes + # Check that files have not changed. + - run: | + git diff --exit-code + + check-config-file-headers: + runs-on: ubuntu-latest + name: Check that config file headers are up to date + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: | + task github-actions:config-headers:update --yes + # Check that files have not changed. + - run: | + git diff --exit-code + + check-links: + runs-on: ubuntu-latest + name: Check that workflow and config file links are up to date + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: | + task github-actions:link --yes + # Check that files have not changed. + - run: | + git diff --exit-code + + lint-markdown: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: | + SKIP_FIX=1 task lint:markdown + + lint-shell-script: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: | + SKIP_FIX=1 task lint:shell-script diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml new file mode 100644 index 00000000..60fc0ee5 --- /dev/null +++ b/.github/workflows/markdown.yaml @@ -0,0 +1,43 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/markdown.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Markdown +### +### Lints Markdown files (`**/*.md`) in the project. +### +### [markdownlint-cli configuration +### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration), +### `.markdownlint.jsonc` and `.markdownlintignore`, control what is actually +### linted and how. +### +### #### Assumptions +### +### 1. A docker compose service named `markdownlint` for running `markdownlint` +### (from +### [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli)) +### exists. + +name: Markdown + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + markdown-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm markdownlint markdownlint '**/*.md' diff --git a/.github/workflows/workflow-template.yaml b/.github/workflows/workflow-template.yaml new file mode 100644 index 00000000..b7f8cf71 --- /dev/null +++ b/.github/workflows/workflow-template.yaml @@ -0,0 +1,26 @@ +on: pull_request + +name: Workflow templates + +jobs: + check-yaml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: | + docker pull mikefarah/yq + for f in $(find github/workflows/ -name '*.yaml'); do + docker run --rm --volume "$PWD":/workdir mikefarah/yq "$f" > /dev/null + done + + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - run: | + task lint:shell-script diff --git a/.github/workflows/yaml.yaml b/.github/workflows/yaml.yaml new file mode 100644 index 00000000..1c0ada3f --- /dev/null +++ b/.github/workflows/yaml.yaml @@ -0,0 +1,40 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/yaml.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### YAML +### +### Validates YAML files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. +### +### #### Symfony YAML +### +### Symfony's YAML config files use 4 spaces for indentation and single quotes. +### Therefore we use a [Prettier configuration +### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make +### Prettier format YAML files in the `config/` folder like Symfony expects. + +name: YAML + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + yaml-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier '**/*.{yml,yaml}' --check diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..26ba4790 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.task diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 00000000..37d8959c --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,19 @@ +// markdownlint-cli configuration file (cf. https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration) +{ + "default": true, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md + "line-length": { + "line_length": 120, + "code_blocks": false, + "tables": false + }, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md + "no-duplicate-heading": { + "siblings_only": true + }, + // https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections#creating-a-collapsed-section + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md + "no-inline-html": { + "allowed_elements": ["details", "summary"] + } +} diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 00000000..3869d411 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1,8 @@ +# https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#ignoring-files +vendor/ +node_modules/ +LICENSE.md +# Drupal +web/*.md +web/core/ +web/*/contrib/ diff --git a/CHANGELOG.md b/CHANGELOG.md index d68152ad..08d0862e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- [PR-108](https://github.com/itk-dev/devops_itkdev-docker/pull/108) + Added Drupal module template + ### Changed - Updated to PHP 8.3 diff --git a/README.md b/README.md index 4b532d2b..c6244b14 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ __Note__: You have to follow the instructions brew writes to get it working (use If you use the [Dory](https://github.com/FreedomBen/dory) revers proxy required to run DDF CMS unmodified you need to install dory. We only use dory for DPL/DDF shared projects (multi supplier projects). + ```sh brew install dory ``` @@ -46,14 +47,20 @@ brew install dory ### Templates The [`templates`](templates/) directory contains templates for adding -the itkdev `docker-compose` setup to new or exiting projects. +the itkdev `docker compose` setup to new or exiting projects. + +Run ```sh -rsync -avz templates// +itkdev-docker-compose template:install --list ``` -Also create an `.env` file beside the `docker-compose.yml` file that contains -`COMPOSE_PROJECT_NAME=` to namespace the docker setup for the projekt. +to see a list of all templates. + +Run `itkdev-docker-compose template:install drupal-10`, say, to install or update a template in a project. + +In addition to the docker compose setup for our projects, installing a template will also add GitHib Actions workflow +files to a project; see [Github Actions templates](docs/github-actions-templates.md) for details. ### Docker commands @@ -112,13 +119,15 @@ LOCAL_PATH='sites/default/files' ## SSL certification support -This setup comes with self-signed wildcard certificates for *.local.itkdev.dk, but other certificates can be generated by using this openssl command on Mac, just change the two places where the domain is written. +This setup comes with self-signed wildcard certificates for *.local.itkdev.dk, but other certificates can be generated +by using this openssl command on Mac, just change the two places where the domain is written. ```sh openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -keyout docker.key -out docker.crt -subj "/CN=*.local.itkdev.dk" -reqexts SAN -extensions SAN -config <(cat /usr/local/etc/openssl/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:*.local.itkdev.dk')) ``` -To mac browser trust this certificate you need to open it with key-chain right click and select "Get info" and then open the "Trust" tab and select "Always trust". +To mac browser trust this certificate you need to open it with key-chain right click and select "Get info" and then open +the "Trust" tab and select "Always trust". The certificate is located in `./treafik/ssl/docker.crt` in this repository. @@ -158,17 +167,19 @@ The fuld list can be found at [https://hub.docker.com/search?q=itkdev&type=image](https://hub.docker.com/search?q=itkdev&type=image). ## More -For more details about usage see https://docs.itkdev.dk + +For more details about usage see ## Previous versions ### NFS mounts removed From version 3.0.0 the feature to use NFS mounted name-volumes has been removed -because it is no longer compatible with MacOS. (@see https://github.com/docker/for-mac/issues/6544) +because it is no longer compatible with MacOS. (@see ) If you have previously enabled NFS with `nfs:enable` you should clean up as follows: + ```shell sudo nano /etc/exports # Delete the line matching this pattern, and save you changes diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 00000000..3ce3dc80 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,64 @@ +# https://taskfile.dev + +version: "3" + +includes: + github-actions: ./task/Taskfile.github-actions.yml + +vars: + GITHUB_ACTIONS_TEMPLATES_HEADER: | + # Github Actions templates + + This repository contains a number of [GitHub + Actions](https://docs.github.com/en/actions) workflow template files that + are copied to a project when running `itkdev-docker-compose + template:install`. Any changes to the workflows should be made in [this + repository](%THIS_REPOSITORY%) and then the project template must be updated + to match the new templates. + + GITHUB_ACTIONS_TEMPLATES_FOOTER: | + +tasks: + build: + desc: "Build everything" + cmds: + - task: github-actions:config-headers:update + - task: github-actions:template-headers:update + - task: github-actions:documentation:update + - task: github-actions:link + - task: lint:markdown + - task: lint:yaml + + lint:markdown: + desc: "Lint Markdown" + cmds: + - '[[ -n "$SKIP_FIX" ]] || docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}} --fix' + - docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}} + vars: + # We use a block scalar (https://yaml-multiline.info/#block-scalars) here to make escaping (a little) easier. + GLOB: >- + {{.CLI_ARGS | default "'**/*.md'"}} + + lint:shell-script: + desc: "Lint shell scripts" + cmds: + # https://github.com/koalaman/shellcheck?tab=readme-ov-file#installing + - docker run --rm --volume "$PWD:"/mnt koalaman/shellcheck:stable {{.GLOB}} + vars: + # We use a block scalar (https://yaml-multiline.info/#block-scalars) here to make escaping (a little) easier. + GLOB: >- + {{.CLI_ARGS | default "task/scripts/*"}} + + lint:yaml: + desc: "Lint YAML" + cmds: + - | + # docker pull mikefarah/yq + for f in $(find github/workflows/ -name '*.yaml'); do + docker run --rm --volume "$PWD":/workdir mikefarah/yq "$f" > /dev/null + done + + default: + cmds: + - task --list + silent: true diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 00000000..d3f6f829 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,18 @@ +services: + markdownlint: + image: itkdev/markdownlint + profiles: + - dev + volumes: + - ./:/md + + prettier: + # Prettier does not (yet, fcf. + # https://github.com/prettier/prettier/issues/15206) have an official + # docker image. + # https://hub.docker.com/r/jauderho/prettier is good candidate (cf. https://hub.docker.com/search?q=prettier&sort=updated_at&order=desc) + image: jauderho/prettier + profiles: + - dev + volumes: + - ./:/work diff --git a/config/drupal-module/php/.phpcs.xml.dist b/config/drupal-module/php/.phpcs.xml.dist new file mode 100644 index 00000000..a97dd835 --- /dev/null +++ b/config/drupal-module/php/.phpcs.xml.dist @@ -0,0 +1,31 @@ + + + + + + The coding standard. + + . + + + node_modules + vendor + *.css + *.js + + + + + + + + + + + + + + + + + diff --git a/config/drupal-module/twig/.twig-cs-fixer.dist.php b/config/drupal-module/twig/.twig-cs-fixer.dist.php new file mode 100644 index 00000000..35cf5317 --- /dev/null +++ b/config/drupal-module/twig/.twig-cs-fixer.dist.php @@ -0,0 +1,16 @@ +in(__DIR__); +// … that are not ignored by VCS +$finder->ignoreVCSIgnored(true); + +$config = new TwigCsFixer\Config\Config(); +$config->setFinder($finder); + +return $config; diff --git a/config/drupal/php/.phpcs.xml.dist b/config/drupal/php/.phpcs.xml.dist new file mode 100644 index 00000000..c8f54bd8 --- /dev/null +++ b/config/drupal/php/.phpcs.xml.dist @@ -0,0 +1,33 @@ + + + + + + The coding standard. + + web/modules/custom/ + web/themes/custom/ + + + node_modules + vendor + web/*/custom/*/build/ + *.css + *.js + + + + + + + + + + + + + + + + + diff --git a/config/drupal/twig/.twig-cs-fixer.dist.php b/config/drupal/twig/.twig-cs-fixer.dist.php new file mode 100644 index 00000000..0a0f2951 --- /dev/null +++ b/config/drupal/twig/.twig-cs-fixer.dist.php @@ -0,0 +1,16 @@ +in(__DIR__); +// … that are not ignored by VCS +$finder->ignoreVCSIgnored(true); + +$config = new TwigCsFixer\Config\Config(); +$config->setFinder($finder); + +return $config; diff --git a/config/markdown/.markdownlint.jsonc b/config/markdown/.markdownlint.jsonc new file mode 100644 index 00000000..02530965 --- /dev/null +++ b/config/markdown/.markdownlint.jsonc @@ -0,0 +1,22 @@ +// This file is copied from config/markdown/.markdownlint.jsonc in https://github.com/itk-dev/devops_itkdev-docker. +// Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +// markdownlint-cli configuration file (cf. https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration) +{ + "default": true, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md + "line-length": { + "line_length": 120, + "code_blocks": false, + "tables": false + }, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md + "no-duplicate-heading": { + "siblings_only": true + }, + // https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections#creating-a-collapsed-section + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md + "no-inline-html": { + "allowed_elements": ["details", "summary"] + } +} diff --git a/config/markdown/.markdownlintignore b/config/markdown/.markdownlintignore new file mode 100644 index 00000000..d143acee --- /dev/null +++ b/config/markdown/.markdownlintignore @@ -0,0 +1,12 @@ +# This file is copied from config/markdown/.markdownlintignore in https://github.com/itk-dev/devops_itkdev-docker. +# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +# https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#ignoring-files +vendor/ +node_modules/ +LICENSE.md +# Drupal +web/*.md +web/core/ +web/libraries/ +web/*/contrib/ diff --git a/config/symfony/php/.php-cs-fixer.dist.php b/config/symfony/php/.php-cs-fixer.dist.php new file mode 100644 index 00000000..c23b927b --- /dev/null +++ b/config/symfony/php/.php-cs-fixer.dist.php @@ -0,0 +1,20 @@ +in(__DIR__); +// … that are not ignored by VCS +$finder->ignoreVCSIgnored(true); + +$config = new PhpCsFixer\Config(); +$config->setFinder($finder); + +$config->setRules([ + '@Symfony' => true, +]); + +return $config; diff --git a/config/symfony/twig/.twig-cs-fixer.dist.php b/config/symfony/twig/.twig-cs-fixer.dist.php new file mode 100644 index 00000000..82425550 --- /dev/null +++ b/config/symfony/twig/.twig-cs-fixer.dist.php @@ -0,0 +1,16 @@ +in(__DIR__); +// … that are not ignored by VCS +$finder->ignoreVCSIgnored(true); + +$config = new TwigCsFixer\Config\Config(); +$config->setFinder($finder); + +return $config; diff --git a/config/symfony/yaml/.prettierrc.yaml b/config/symfony/yaml/.prettierrc.yaml new file mode 100644 index 00000000..12e08983 --- /dev/null +++ b/config/symfony/yaml/.prettierrc.yaml @@ -0,0 +1,11 @@ +# This file is copied from config/symfony/yaml/.prettierrc.yaml in https://github.com/itk-dev/devops_itkdev-docker. +# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. + +# https://prettier.io/docs/configuration +overrides: + # Symfony config + - files: + - "config/**/*.{yml,yaml}" + options: + tabWidth: 4 + singleQuote: true diff --git a/docs/github-actions-templates.md b/docs/github-actions-templates.md new file mode 100644 index 00000000..c462c63a --- /dev/null +++ b/docs/github-actions-templates.md @@ -0,0 +1,344 @@ + +# Github Actions templates + +This repository contains a number of [GitHub Actions](https://docs.github.com/en/actions) workflow template files that +are copied to a project when running `itkdev-docker-compose template:install`. Any changes to the workflows should be +made in [this repository](https://github.com/itk-dev/devops_itkdev-docker) and then the project template must be updated +to match the new templates. + +## Naming conventions + +* A workflow file is named after what it is _concerned_ with, not _how_ it's concerned with it and which tools are + actually used, i.e. we have a [`markdown.yaml`](github/workflows/markdown.yaml) file and not a `markdownlint.yaml` + file. +* Some workflows are specific to a project type, currently `drupal` or `symfony`, and these sit in a project type + subfolder, e.g. `github/workflows/drupal`. +* Some tools require configuration files, and these sit in the `config` folder. Some tool configuration may be specific + to a project type (or make sence only for a specific project type), and these specific config files sit in a project + type subfolder, e.g. `config/drupal/php/.phpcs.xml.dist` and `config/drupal/twig/.twig-cs-fixer.dist.php` + +## Templates + +The current list of templates is shown in the following sections. + +--- + +[github/workflows/changelog.yaml](github/workflows/changelog.yaml) + +### Changelog + +Checks that changelog has been updated + +--- + +[github/workflows/composer.yaml](github/workflows/composer.yaml) + +### Composer + +Validates composer.json and checks that it's normalized. + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. +2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize) + is a dev requirement in `composer.json`: + + ``` shell + docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize + ``` + + Normalize `composer.json` by running + + ``` shell + docker compose run --rm phpfpm composer normalize + ``` + +--- + +[github/workflows/drupal-module/javascript.yaml](github/workflows/drupal-module/javascript.yaml) + +### Drupal module JavaScript (and TypeScript) + +Validates JavaScript files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/drupal-module/php.yaml](github/workflows/drupal-module/php.yaml) + +### Drupal module PHP + +Checks that PHP code adheres to the [Drupal coding +standards](https://www.drupal.org/docs/develop/standards). + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. +2. [drupal/coder](https://www.drupal.org/project/coder) is a dev requirement +in `composer.json`: + + ``` shell + docker compose run --rm phpfpm composer require --dev drupal/coder + ``` + + Clean up and check code by running + + ``` shell + docker compose run --rm phpfpm vendor/bin/phpcbf + docker compose run --rm phpfpm vendor/bin/phpcs + ``` + +> [!NOTE] +> The template adds `.phpcs.xml.dist` as [a configuration file for +> PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file) +> and this makes it possible to override the actual configuration used in a +> project by adding a more important configuration file, e.g. `.phpcs.xml`. + +--- + +[github/workflows/drupal-module/styles.yaml](github/workflows/drupal-module/styles.yaml) + +### Drupal module Styles (CSS and SCSS) + +Validates styles files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/drupal/javascript.yaml](github/workflows/drupal/javascript.yaml) + +### Drupal JavaScript (and TypeScript) + +Validates JavaScript files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/drupal/php.yaml](github/workflows/drupal/php.yaml) + +### Drupal PHP + +Checks that PHP code adheres to the [Drupal coding +standards](https://www.drupal.org/docs/develop/standards). + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. +2. [drupal/coder](https://www.drupal.org/project/coder) is a dev requirement +in `composer.json`: + + ``` shell + docker compose run --rm phpfpm composer require --dev drupal/coder + ``` + + Clean up and check code by running + + ``` shell + docker compose run --rm phpfpm vendor/bin/phpcbf + docker compose run --rm phpfpm vendor/bin/phpcs + ``` + +> [!NOTE] +> The template adds `.phpcs.xml.dist` as [a configuration file for +> PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file) +> and this makes it possible to override the actual configuration used in a +> project by adding a more important configuration file, e.g. `.phpcs.xml`. + +--- + +[github/workflows/drupal/site.yaml](github/workflows/drupal/site.yaml) + +### Drupal + +Checks that site can be installed and can be updated (from base branch on +pull request). + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. +2. The docker setup contains a database container and other the dependent + services and the default settings match connection credentials for these + services. +3. The Drupal site can be installed from existing config. + +--- + +[github/workflows/drupal/styles.yaml](github/workflows/drupal/styles.yaml) + +### Drupal Styles (CSS and SCSS) + +Validates styles files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/markdown.yaml](github/workflows/markdown.yaml) + +### Markdown + +Lints Markdown files (`**/*.md`) in the project. + +[markdownlint-cli configuration +files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration), +`.markdownlint.jsonc` and `.markdownlintignore`, control what is actually +linted and how. + +#### Assumptions + +1. A docker compose service named `markdownlint` for running `markdownlint` + (from + [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli)) + exists. + +--- + +[github/workflows/symfony/javascript.yaml](github/workflows/symfony/javascript.yaml) + +### Symfony JavaScript (and TypeScript) + +Validates JavaScript files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/symfony/php.yaml](github/workflows/symfony/php.yaml) + +### Symfony PHP + +Checks that PHP code adheres to the [Symfony coding +standards](https://symfony.com/doc/current/contributing/code/standards.html). + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. 2. + [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) + is a dev requirement in `composer.json`: + + ``` shell + docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer + ``` + + Clean up and check code by running + + ``` shell + docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix + docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff + ``` + +> [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration +> file for PHP CS +> Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst) +> and this makes it possible to override the actual configuration used in a +> project by adding a more important configuration file, `.php-cs-fixer.php`. + +--- + +[github/workflows/symfony/styles.yaml](github/workflows/symfony/styles.yaml) + +### Symfony Styles (CSS and SCSS) + +Validates styles files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +--- + +[github/workflows/twig.yaml](github/workflows/twig.yaml) + +### Twig + +Validates Twig files + +#### Assumptions + +1. A docker compose service named `phpfpm` can be run and `composer` can be + run inside the `phpfpm` service. +2. [vincentlanglet/twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer) + is a dev requirement in `composer.json`: + + ``` shell + docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer + ``` + +3. A [Configuration + file](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file) + in the root of the project defines which files to check and rules to use. + +--- + +[github/workflows/yaml.yaml](github/workflows/yaml.yaml) + +### YAML + +Validates YAML files. + +#### Assumptions + +1. A docker compose service named `prettier` for running + [Prettier](https://prettier.io/) exists. + +#### Symfony YAML + +Symfony's YAML config files use 4 spaces for indentation and single quotes. +Therefore we use a [Prettier configuration +file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make +Prettier format YAML files in the `config/` folder like Symfony expects. + +--- + +## Updating template documentation + +To update this document, run + +``` shell +task github-actions:documentation:update +``` + +### GitHub Actions workflow documentation convention + +Each workflow file must contain a single documentation block with lines starting with `###`, e.g. + +``` markdown +### ### The title +### +### This template … +### +### See … for details. +``` + +> [!IMPORTANT] +> All lines in the documentation block must start with `###` and the documentation block consists of all consecutive +> lines starting with `###`. diff --git a/github/workflows/changelog.yaml b/github/workflows/changelog.yaml new file mode 100644 index 00000000..483da6e9 --- /dev/null +++ b/github/workflows/changelog.yaml @@ -0,0 +1,29 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/changelog.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Changelog +### +### Checks that changelog has been updated + +name: Changelog + +on: + pull_request: + +jobs: + changelog: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Git fetch + run: git fetch + + - name: Check that changelog has been updated. + run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0 diff --git a/github/workflows/composer.yaml b/github/workflows/composer.yaml new file mode 100644 index 00000000..fe133512 --- /dev/null +++ b/github/workflows/composer.yaml @@ -0,0 +1,68 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/composer.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Composer +### +### Validates composer.json and checks that it's normalized. +### +### #### Assumptions +### +### 1. A docker compose service named `phpfpm` can be run and `composer` can be +### run inside the `phpfpm` service. +### 2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize) +### is a dev requirement in `composer.json`: +### +### ``` shell +### docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize +### ``` +### +### Normalize `composer.json` by running +### +### ``` shell +### docker compose run --rm phpfpm composer normalize +### ``` + +name: Composer + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + composer-validate: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer validate --strict + + composer-normalized: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer install + docker compose run --rm phpfpm composer normalize --dry-run + + composer-audit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer audit diff --git a/github/workflows/drupal-module/javascript.yaml b/github/workflows/drupal-module/javascript.yaml new file mode 100644 index 00000000..54ef6e27 --- /dev/null +++ b/github/workflows/drupal-module/javascript.yaml @@ -0,0 +1,36 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal-module/javascript.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal module JavaScript (and TypeScript) +### +### Validates JavaScript files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. + +name: JavaScript + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + javascript-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier 'js/**/*.js' --check diff --git a/github/workflows/drupal-module/php.yaml b/github/workflows/drupal-module/php.yaml new file mode 100644 index 00000000..4218f4de --- /dev/null +++ b/github/workflows/drupal-module/php.yaml @@ -0,0 +1,55 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal-module/php.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal module PHP +### +### Checks that PHP code adheres to the [Drupal coding +### standards](https://www.drupal.org/docs/develop/standards). +### +### #### Assumptions +### +### 1. A docker compose service named `phpfpm` can be run and `composer` can be +### run inside the `phpfpm` service. +### 2. [drupal/coder](https://www.drupal.org/project/coder) is a dev requirement +### in `composer.json`: +### +### ``` shell +### docker compose run --rm phpfpm composer require --dev drupal/coder +### ``` +### +### Clean up and check code by running +### +### ``` shell +### docker compose run --rm phpfpm vendor/bin/phpcbf +### docker compose run --rm phpfpm vendor/bin/phpcs +### ``` +### +### > [!NOTE] +### > The template adds `.phpcs.xml.dist` as [a configuration file for +### > PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file) +### > and this makes it possible to override the actual configuration used in a +### > project by adding a more important configuration file, e.g. `.phpcs.xml`. + +name: PHP + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + coding-standards: + name: PHP - Check Coding Standards + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer install + docker compose run --rm phpfpm vendor/bin/phpcs diff --git a/github/workflows/drupal-module/styles.yaml b/github/workflows/drupal-module/styles.yaml new file mode 100644 index 00000000..0d5cdc0b --- /dev/null +++ b/github/workflows/drupal-module/styles.yaml @@ -0,0 +1,36 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal-module/styles.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal module Styles (CSS and SCSS) +### +### Validates styles files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. + +name: Styles + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + styles-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier 'css/**/*.css' --check diff --git a/github/workflows/drupal/javascript.yaml b/github/workflows/drupal/javascript.yaml new file mode 100644 index 00000000..65d54681 --- /dev/null +++ b/github/workflows/drupal/javascript.yaml @@ -0,0 +1,36 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal/javascript.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal JavaScript (and TypeScript) +### +### Validates JavaScript files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. + +name: JavaScript + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + javascript-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier 'web/themes/custom/**/js/**/*.js' --check diff --git a/github/workflows/drupal/php.yaml b/github/workflows/drupal/php.yaml new file mode 100644 index 00000000..1bd5a93a --- /dev/null +++ b/github/workflows/drupal/php.yaml @@ -0,0 +1,55 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal/php.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal PHP +### +### Checks that PHP code adheres to the [Drupal coding +### standards](https://www.drupal.org/docs/develop/standards). +### +### #### Assumptions +### +### 1. A docker compose service named `phpfpm` can be run and `composer` can be +### run inside the `phpfpm` service. +### 2. [drupal/coder](https://www.drupal.org/project/coder) is a dev requirement +### in `composer.json`: +### +### ``` shell +### docker compose run --rm phpfpm composer require --dev drupal/coder +### ``` +### +### Clean up and check code by running +### +### ``` shell +### docker compose run --rm phpfpm vendor/bin/phpcbf +### docker compose run --rm phpfpm vendor/bin/phpcs +### ``` +### +### > [!NOTE] +### > The template adds `.phpcs.xml.dist` as [a configuration file for +### > PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file) +### > and this makes it possible to override the actual configuration used in a +### > project by adding a more important configuration file, e.g. `.phpcs.xml`. + +name: PHP + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + coding-standards: + name: PHP - Check Coding Standards + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer install + docker compose run --rm phpfpm vendor/bin/phpcs diff --git a/github/workflows/drupal/site.yaml b/github/workflows/drupal/site.yaml new file mode 100644 index 00000000..92ce5ab4 --- /dev/null +++ b/github/workflows/drupal/site.yaml @@ -0,0 +1,127 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/drupal/site.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Drupal +### +### Checks that site can be installed and can be updated (from base branch on +### pull request). +### +### #### Assumptions +### +### 1. A docker compose service named `phpfpm` can be run and `composer` can be +### run inside the `phpfpm` service. +### 2. The docker setup contains a database container and other the dependent +### services and the default settings match connection credentials for these +### services. +### 3. The Drupal site can be installed from existing config. + +name: Drupal + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + install-site: + name: Check that site can be installed + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Start docker and install dependencies + run: | + docker network create frontend + docker compose pull + docker compose up --detach + + # Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect. + docker compose exec phpfpm composer install --no-interaction + + - name: Install site + run: | + # Add some local settings. + cat > web/sites/default/settings.local.php <<'EOF' + web/sites/default/settings.local.php <<'EOF' + [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration +### > file for PHP CS +### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst) +### > and this makes it possible to override the actual configuration used in a +### > project by adding a more important configuration file, `.php-cs-fixer.php`. + +name: Symfony PHP + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + coding-standards: + name: PHP - Check Coding Standards + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + docker network create frontend + docker compose run --rm phpfpm composer install + # https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command + docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff diff --git a/github/workflows/symfony/styles.yaml b/github/workflows/symfony/styles.yaml new file mode 100644 index 00000000..edc79602 --- /dev/null +++ b/github/workflows/symfony/styles.yaml @@ -0,0 +1,36 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/symfony/styles.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Symfony Styles (CSS and SCSS) +### +### Validates styles files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. + +name: Styles + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + styles-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier 'assets/**/*.{css,scss}' --check diff --git a/github/workflows/twig.yaml b/github/workflows/twig.yaml new file mode 100644 index 00000000..9b0e3431 --- /dev/null +++ b/github/workflows/twig.yaml @@ -0,0 +1,48 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/twig.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### Twig +### +### Validates Twig files +### +### #### Assumptions +### +### 1. A docker compose service named `phpfpm` can be run and `composer` can be +### run inside the `phpfpm` service. +### 2. [vincentlanglet/twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer) +### is a dev requirement in `composer.json`: +### +### ``` shell +### docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer +### ``` +### +### 3. A [Configuration +### file](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file) +### in the root of the project defines which files to check and rules to use. + +name: Twig + +env: + COMPOSE_USER: root + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + twig-lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - run: | + docker network create frontend + docker compose run --rm phpfpm composer install + docker compose run --rm phpfpm vendor/bin/twig-cs-fixer lint diff --git a/github/workflows/yaml.yaml b/github/workflows/yaml.yaml new file mode 100644 index 00000000..1c0ada3f --- /dev/null +++ b/github/workflows/yaml.yaml @@ -0,0 +1,40 @@ +# Do not edit this file! Make a pull request on changing +# github/workflows/yaml.yaml in +# https://github.com/itk-dev/devops_itkdev-docker if need be. + +### ### YAML +### +### Validates YAML files. +### +### #### Assumptions +### +### 1. A docker compose service named `prettier` for running +### [Prettier](https://prettier.io/) exists. +### +### #### Symfony YAML +### +### Symfony's YAML config files use 4 spaces for indentation and single quotes. +### Therefore we use a [Prettier configuration +### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make +### Prettier format YAML files in the `config/` folder like Symfony expects. + +name: YAML + +on: + pull_request: + push: + branches: + - main + - develop + +jobs: + yaml-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: | + docker network create frontend + + - run: | + docker compose run --rm prettier '**/*.{yml,yaml}' --check diff --git a/scripts/itkdev-docker-compose b/scripts/itkdev-docker-compose index b780e4d6..679e357a 100755 --- a/scripts/itkdev-docker-compose +++ b/scripts/itkdev-docker-compose @@ -107,7 +107,9 @@ function template_install { fi echo "${bold}Installing $name template${normal}" - rsync --archive $source_dir $target_dir + # Use --copy-links to copy actual files rather than symlinks (cf. + # https://linux.die.net/man/1/rsync#:~:text=%2DL%2C-,%2D%2Dcopy%2Dlinks,-When%20symlinks%20are) + rsync --archive --copy-links "$source_dir" "$target_dir" local project_name_default=$(basename $target_dir) diff --git a/task/Taskfile.github-actions.yml b/task/Taskfile.github-actions.yml new file mode 100644 index 00000000..f92d3e1a --- /dev/null +++ b/task/Taskfile.github-actions.yml @@ -0,0 +1,74 @@ +version: "3" + +tasks: + documentation:update: + desc: "Update GitHub Actions template documentation" + cmds: + - task: run-script + vars: + SCRIPT: github-documentation-update + - SKIP_FIX=1 task lint:markdown -- docs/github-actions-templates.md + + documentation:diff: + desc: "Diff generated documentation ignoring select lines" + cmds: + # Ignore some PO metadata when git diff'ing, e.g. + # + # "POT-Creation-Date: 2025-03-12 18:18+0100\n" + # "PO-Revision-Date: 2025-03-12 18:18+0100\n" + - git diff --exit-code --ignore-blank-lines --ignore-matching-lines='automatically created' '*.md' + + documentation:checkout: + desc: "git checkout all translation file changes if only date metadata is changed" + cmds: + - git checkout '*.md' + # https://taskfile.dev/reference/schema#precondition + preconditions: + - sh: task {{.TASK | replace ":checkout" ":diff" }} + msg: | + Translations seem to have changed. + + Run + + task {{.TASK | replace ":checkout" ":diff" }} + + to check. + + template-headers:update: + prompt: "Updating headers may break things, so check result afterwards. Really update headers?" + desc: "Update headers in GitHub Actions templates" + cmds: + - task: run-script + vars: + SCRIPT: template-headers-update + + config-headers:update: + prompt: "Updating headers may break things, so check result afterwards. Really update headers?" + desc: "Update headers in tool config" + cmds: + - task: run-script + vars: + SCRIPT: config-headers-update + + link: + desc: "Set up symlinks" + prompt: "Reset all symlinks?" + cmds: + - task: run-script + vars: + SCRIPT: github-actions-link + silent: true + + show: + desc: "Show links" + cmds: + - find templates -type l -ls + silent: true + + run-script: + internal: true + cmds: + - docker run --rm --volume "$PWD:/app" --user ${COMPOSE_USER:-deploy} itkdev/php8.4-fpm:latest task/scripts/{{.SCRIPT}} + requires: + vars: + - SCRIPT diff --git a/task/docs/github-actions-templates.md b/task/docs/github-actions-templates.md new file mode 100644 index 00000000..e2fad1bb --- /dev/null +++ b/task/docs/github-actions-templates.md @@ -0,0 +1,23 @@ + +# Github Actions templates + +This repository contains a number of [GitHub Actions](https://docs.github.com/en/actions) workflow template files that +are copied to a project when running `itkdev-docker-compose template:install`. Any changes to the workflows should be +made in [this repository](https://github.com/itk-dev/devops_itkdev-docker) and then the project template must be updated +to match the new templates. + +## Naming conventions + +* Named after what a tool is concerned with, not how it's concerned with it. +* Some configuration based on template type (drupal, symfony) + +## Templates + +--- + +[github/workflows/*.yaml](github/workflows/*.yaml) + +--- diff --git a/task/scripts/config-headers-update b/task/scripts/config-headers-update new file mode 100755 index 00000000..035f27df --- /dev/null +++ b/task/scripts/config-headers-update @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +project_dir=$(cd "$(dirname "$script_dir")/.." && pwd) + +cd "$project_dir" || exit + +# shellcheck disable=SC2044 +for f in $(find config -type f); do + echo "$f" + + # Remove exiting header. + # This is done by deleting all lines from the top of the file to a blank line. + sed -i '1,/^$/d' "$f" + + comment_prefix='' + comment_start='# ' + comment_end='' + if [[ "$f" =~ \.php(\.dist)?$ ]]; then + comment_prefix='' + comment_start='' + fi + # Write header and file into temporary file. + ( + [[ -n "${comment_prefix}" ]] && echo "${comment_prefix}" + echo "${comment_start}This file is copied from $f in https://github.com/itk-dev/devops_itkdev-docker.${comment_end}" + echo "${comment_start}Feel free to edit the file, but consider making a pull request if you find a general issue with the file.${comment_end}" + echo "" + cat "$f" + ) > "$f.tmp" + # Replace original file with temporary file. + mv "$f.tmp" "$f" +done diff --git a/task/scripts/github-actions-link b/task/scripts/github-actions-link new file mode 100755 index 00000000..e7ec2756 --- /dev/null +++ b/task/scripts/github-actions-link @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +set -o errexit -o errtrace -o noclobber -o nounset -o pipefail +IFS=$'\n\t' + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +project_dir=$(cd "$(dirname "$script_dir")/.." && pwd) + +cd "$project_dir" || exit + +# String type (drupal or symfony) from start of name +function strip-project-type() { + name=$1 + + if [[ "$name" =~ ^(drupal(-module)?|symfony)/(.+) ]]; then + name="${BASH_REMATCH[3]}" + fi + + echo "$name" +} + +find templates -type l -delete + +for template_dir in templates/*; do + template_name=$(basename "$template_dir") + + echo "$template_name" + echo + + project_type="" + if [[ "$template_name" =~ ^drupal-module ]]; then + project_type="drupal-module" + elif [[ "$template_name" =~ ^drupal- ]]; then + project_type="drupal" + elif [[ "$template_name" =~ ^symfony- ]]; then + project_type="symfony" + else + (>&2 echo "Unknown template type: $template_name") + exit 1 + fi + + for f in $(find github/workflows/ -name '*.yaml' | sort); do + source_file_name='' + # Note: / is NOT a regex delimiter here, but an actual /, i.e. a directory separator. + if [[ "$f" =~ /drupal-module/ ]]; then + if [[ "$project_type" == "drupal-module" ]]; then + source_file_name="$(basename "$(dirname "$f")")/$(basename "$f")" + fi + elif [[ "$f" =~ /drupal/ ]]; then + if [[ "$project_type" == "drupal" ]]; then + source_file_name="$(basename "$(dirname "$f")")/$(basename "$f")" + fi + elif [[ "$f" =~ /symfony/ ]]; then + if [[ "$project_type" == "symfony" ]]; then + source_file_name="$(basename "$(dirname "$f")")/$(basename "$f")" + fi + else + source_file_name=$(basename "$f") + fi + + if [[ -n "$source_file_name" ]]; then + # Link GitHub Actions workflow file + target_dir="$template_dir/.github/workflows" + mkdir -p "$target_dir" + ln -sf "../../../../github/workflows/$source_file_name" "$target_dir/$(strip-project-type "$source_file_name")" + + # Check if we need a language configuration as well + language_name=${source_file_name%.yaml} + config_dir="" + # Check for project_type specific configuration first. + if [ -d "config/$project_type/$language_name" ]; then + config_dir="config/$project_type/$language_name" + elif [ -d "config/$language_name" ]; then + config_dir="config/$language_name" + fi + + if [[ -n "$config_dir" ]]; then + # Some config files are hidden + GLOBIGNORE=".:.." + for config_file in "$config_dir"/*; do + if [ -f "$config_file" ]; then + ln -sf "../../$config_file" "$template_dir/" + fi + done + fi + fi + done + + find "$template_dir" -type l -ls + echo +done diff --git a/task/scripts/github-documentation-update b/task/scripts/github-documentation-update new file mode 100755 index 00000000..6eb978d7 --- /dev/null +++ b/task/scripts/github-documentation-update @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# set -o errexit -o errtrace -o noclobber -o nounset -o pipefail +# IFS=$'\n\t' + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +project_dir=$(cd "$(dirname "$script_dir")/.." && pwd) + +cd "$project_dir" || exit + +template_file_name="$script_dir/../templates/github-actions-templates.md" + +placeholder="insert:templates:here" +placeholder_line=$(grep --line-number --no-filename "$placeholder" "$template_file_name" | cut -d: -f1) + +if [[ -z "$placeholder_line" ]]; then + (>&2 echo "Cannot find placeholder $placeholder in $template_file_name") + exit 1 +fi + +output_file_name="docs/$(basename "$template_file_name")" + +mkdir -p "$(dirname "$output_file_name")" + +# Empty the output file +: >| "$output_file_name" + +cat >> "$output_file_name" < +EOF + +# Template content before placeholder +head --lines="$((placeholder_line-1))" "$template_file_name" >> "$output_file_name" + +for f in $(find github/workflows/ -name '*.yaml' | sort); do + # Separator + cat >> "$output_file_name" <> "$output_file_name" +done + +# Template content after placeholder without any leading blank lines (cf. +# https://stackoverflow.com/a/7359879) +tail --lines="+$((placeholder_line+1))" "$template_file_name" | sed '/./,$!d' >> "$output_file_name" + +echo "$output_file_name" diff --git a/task/scripts/template-headers-update b/task/scripts/template-headers-update new file mode 100755 index 00000000..1e3ade3d --- /dev/null +++ b/task/scripts/template-headers-update @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +project_dir=$(cd "$(dirname "$script_dir")/.." && pwd) + +cd "$project_dir" || exit + +# shellcheck disable=SC2044 +for f in $(find github/workflows/ -name '*.yaml'); do + echo "$f" + + # Remove exiting header. + # This is done by deleting all lines from the top of the file to a blank line. + sed -i '1,/^$/d' "$f" + + # Write header and file into temporary file. + ( + echo "# Do not edit this file! Make a pull request on changing" + echo "# $f in" + echo "# https://github.com/itk-dev/devops_itkdev-docker if need be." + echo "" + cat "$f" + ) > "$f.tmp" + # Replace original file with temporary file. + mv "$f.tmp" "$f" +done diff --git a/task/templates/github-actions-templates.md b/task/templates/github-actions-templates.md new file mode 100644 index 00000000..078b0354 --- /dev/null +++ b/task/templates/github-actions-templates.md @@ -0,0 +1,49 @@ +# Github Actions templates + +This repository contains a number of [GitHub Actions](https://docs.github.com/en/actions) workflow template files that +are copied to a project when running `itkdev-docker-compose template:install`. Any changes to the workflows should be +made in [this repository](https://github.com/itk-dev/devops_itkdev-docker) and then the project template must be updated +to match the new templates. + +## Naming conventions + +* A workflow file is named after what it is _concerned_ with, not _how_ it's concerned with it and which tools are + actually used, i.e. we have a [`markdown.yaml`](github/workflows/markdown.yaml) file and not a `markdownlint.yaml` + file. +* Some workflows are specific to a project type, currently `drupal` or `symfony`, and these sit in a project type + subfolder, e.g. `github/workflows/drupal`. +* Some tools require configuration files, and these sit in the `config` folder. Some tool configuration may be specific + to a project type (or make sence only for a specific project type), and these specific config files sit in a project + type subfolder, e.g. `config/drupal/php/.phpcs.xml.dist` and `config/drupal/twig/.twig-cs-fixer.dist.php` + +## Templates + +The current list of templates is shown in the following sections. + + + +--- + +## Updating template documentation + +To update this document, run + +``` shell +task github-actions:documentation:update +``` + +### GitHub Actions workflow documentation convention + +Each workflow file must contain a single documentation block with lines starting with `###`, e.g. + +``` markdown +### ### The title +### +### This template … +### +### See … for details. +``` + +> [!IMPORTANT] +> All lines in the documentation block must start with `###` and the documentation block consists of all consecutive +> lines starting with `###`. diff --git a/templates/drupal-10/.github/workflows/changelog.yaml b/templates/drupal-10/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-10/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/composer.yaml b/templates/drupal-10/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-10/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/javascript.yaml b/templates/drupal-10/.github/workflows/javascript.yaml new file mode 120000 index 00000000..e76b3a56 --- /dev/null +++ b/templates/drupal-10/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/markdown.yaml b/templates/drupal-10/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-10/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/php.yaml b/templates/drupal-10/.github/workflows/php.yaml new file mode 120000 index 00000000..9367a866 --- /dev/null +++ b/templates/drupal-10/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/php.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/site.yaml b/templates/drupal-10/.github/workflows/site.yaml new file mode 120000 index 00000000..001dbf2c --- /dev/null +++ b/templates/drupal-10/.github/workflows/site.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/site.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/styles.yaml b/templates/drupal-10/.github/workflows/styles.yaml new file mode 120000 index 00000000..b3e30b71 --- /dev/null +++ b/templates/drupal-10/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/styles.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/twig.yaml b/templates/drupal-10/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-10/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-10/.github/workflows/yaml.yaml b/templates/drupal-10/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-10/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-10/.markdownlint.jsonc b/templates/drupal-10/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-10/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-10/.markdownlintignore b/templates/drupal-10/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-10/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-10/.phpcs.xml.dist b/templates/drupal-10/.phpcs.xml.dist new file mode 120000 index 00000000..17295906 --- /dev/null +++ b/templates/drupal-10/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-10/.twig-cs-fixer.dist.php b/templates/drupal-10/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..7330065d --- /dev/null +++ b/templates/drupal-10/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-10/docker-compose.server.yml b/templates/drupal-10/docker-compose.server.yml index 6f984b5a..363b08e0 100644 --- a/templates/drupal-10/docker-compose.server.yml +++ b/templates/drupal-10/docker-compose.server.yml @@ -52,7 +52,7 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" memcached: - image: 'memcached:latest' + image: "memcached:latest" restart: unless-stopped networks: - app diff --git a/templates/drupal-10/docker-compose.yml b/templates/drupal-10/docker-compose.yml index 130da86b..5b35a905 100644 --- a/templates/drupal-10/docker-compose.yml +++ b/templates/drupal-10/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php8.3-fpm:latest @@ -62,7 +62,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -75,16 +75,16 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" memcached: image: memcached:alpine networks: - app ports: - - '11211' + - "11211" healthcheck: test: echo "version" | nc -vn -w 1 127.0.0.1 11211 interval: 10s diff --git a/templates/drupal-11/.github/workflows/changelog.yaml b/templates/drupal-11/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-11/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/composer.yaml b/templates/drupal-11/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-11/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/javascript.yaml b/templates/drupal-11/.github/workflows/javascript.yaml new file mode 120000 index 00000000..e76b3a56 --- /dev/null +++ b/templates/drupal-11/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/markdown.yaml b/templates/drupal-11/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-11/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/php.yaml b/templates/drupal-11/.github/workflows/php.yaml new file mode 120000 index 00000000..9367a866 --- /dev/null +++ b/templates/drupal-11/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/php.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/site.yaml b/templates/drupal-11/.github/workflows/site.yaml new file mode 120000 index 00000000..001dbf2c --- /dev/null +++ b/templates/drupal-11/.github/workflows/site.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/site.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/styles.yaml b/templates/drupal-11/.github/workflows/styles.yaml new file mode 120000 index 00000000..b3e30b71 --- /dev/null +++ b/templates/drupal-11/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/styles.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/twig.yaml b/templates/drupal-11/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-11/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-11/.github/workflows/yaml.yaml b/templates/drupal-11/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-11/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-11/.markdownlint.jsonc b/templates/drupal-11/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-11/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-11/.markdownlintignore b/templates/drupal-11/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-11/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-11/.phpcs.xml.dist b/templates/drupal-11/.phpcs.xml.dist new file mode 120000 index 00000000..17295906 --- /dev/null +++ b/templates/drupal-11/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-11/.twig-cs-fixer.dist.php b/templates/drupal-11/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..7330065d --- /dev/null +++ b/templates/drupal-11/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-11/docker-compose.server.yml b/templates/drupal-11/docker-compose.server.yml index e4306ba1..96d401b5 100644 --- a/templates/drupal-11/docker-compose.server.yml +++ b/templates/drupal-11/docker-compose.server.yml @@ -52,7 +52,7 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" memcached: - image: 'memcached:latest' + image: "memcached:latest" restart: unless-stopped networks: - app diff --git a/templates/drupal-11/docker-compose.yml b/templates/drupal-11/docker-compose.yml index 3f1aa268..826b71ec 100644 --- a/templates/drupal-11/docker-compose.yml +++ b/templates/drupal-11/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -59,7 +59,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -81,7 +81,7 @@ services: networks: - app ports: - - '11211' + - "11211" healthcheck: test: echo "version" | nc -vn -w 1 127.0.0.1 11211 interval: 10s diff --git a/templates/drupal-7/.github/workflows/changelog.yaml b/templates/drupal-7/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-7/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/composer.yaml b/templates/drupal-7/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-7/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/javascript.yaml b/templates/drupal-7/.github/workflows/javascript.yaml new file mode 120000 index 00000000..e76b3a56 --- /dev/null +++ b/templates/drupal-7/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/markdown.yaml b/templates/drupal-7/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-7/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/php.yaml b/templates/drupal-7/.github/workflows/php.yaml new file mode 120000 index 00000000..9367a866 --- /dev/null +++ b/templates/drupal-7/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/php.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/site.yaml b/templates/drupal-7/.github/workflows/site.yaml new file mode 120000 index 00000000..001dbf2c --- /dev/null +++ b/templates/drupal-7/.github/workflows/site.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/site.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/styles.yaml b/templates/drupal-7/.github/workflows/styles.yaml new file mode 120000 index 00000000..b3e30b71 --- /dev/null +++ b/templates/drupal-7/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/styles.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/twig.yaml b/templates/drupal-7/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-7/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-7/.github/workflows/yaml.yaml b/templates/drupal-7/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-7/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-7/.markdownlint.jsonc b/templates/drupal-7/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-7/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-7/.markdownlintignore b/templates/drupal-7/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-7/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-7/.phpcs.xml.dist b/templates/drupal-7/.phpcs.xml.dist new file mode 120000 index 00000000..17295906 --- /dev/null +++ b/templates/drupal-7/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-7/.twig-cs-fixer.dist.php b/templates/drupal-7/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..7330065d --- /dev/null +++ b/templates/drupal-7/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-7/docker-compose.server.yml b/templates/drupal-7/docker-compose.server.yml index 2ffbf547..023a758d 100644 --- a/templates/drupal-7/docker-compose.server.yml +++ b/templates/drupal-7/docker-compose.server.yml @@ -51,7 +51,7 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" memcached: - image: 'memcached:latest' + image: "memcached:latest" restart: unless-stopped networks: - app diff --git a/templates/drupal-7/docker-compose.yml b/templates/drupal-7/docker-compose.yml index e79bb13a..628cc8c5 100644 --- a/templates/drupal-7/docker-compose.yml +++ b/templates/drupal-7/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php7.4-fpm:latest @@ -61,7 +61,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -74,16 +74,16 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" memcached: - image: 'memcached:latest' + image: "memcached:latest" networks: - app ports: - - '11211' + - "11211" healthcheck: test: echo "version" | nc -vn -w 1 127.0.0.1 11211 interval: 10s diff --git a/templates/drupal-8/.github/workflows/changelog.yaml b/templates/drupal-8/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-8/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/composer.yaml b/templates/drupal-8/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-8/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/javascript.yaml b/templates/drupal-8/.github/workflows/javascript.yaml new file mode 120000 index 00000000..e76b3a56 --- /dev/null +++ b/templates/drupal-8/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/markdown.yaml b/templates/drupal-8/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-8/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/php.yaml b/templates/drupal-8/.github/workflows/php.yaml new file mode 120000 index 00000000..9367a866 --- /dev/null +++ b/templates/drupal-8/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/php.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/site.yaml b/templates/drupal-8/.github/workflows/site.yaml new file mode 120000 index 00000000..001dbf2c --- /dev/null +++ b/templates/drupal-8/.github/workflows/site.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/site.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/styles.yaml b/templates/drupal-8/.github/workflows/styles.yaml new file mode 120000 index 00000000..b3e30b71 --- /dev/null +++ b/templates/drupal-8/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/styles.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/twig.yaml b/templates/drupal-8/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-8/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-8/.github/workflows/yaml.yaml b/templates/drupal-8/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-8/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-8/.markdownlint.jsonc b/templates/drupal-8/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-8/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-8/.markdownlintignore b/templates/drupal-8/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-8/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-8/.phpcs.xml.dist b/templates/drupal-8/.phpcs.xml.dist new file mode 120000 index 00000000..17295906 --- /dev/null +++ b/templates/drupal-8/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-8/.twig-cs-fixer.dist.php b/templates/drupal-8/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..7330065d --- /dev/null +++ b/templates/drupal-8/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-8/docker-compose.server.yml b/templates/drupal-8/docker-compose.server.yml index d5a39d2d..4114feba 100644 --- a/templates/drupal-8/docker-compose.server.yml +++ b/templates/drupal-8/docker-compose.server.yml @@ -50,7 +50,7 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" memcached: - image: 'memcached:latest' + image: "memcached:latest" restart: unless-stopped networks: - app diff --git a/templates/drupal-8/docker-compose.yml b/templates/drupal-8/docker-compose.yml index da6b4b0a..e1fac7fa 100644 --- a/templates/drupal-8/docker-compose.yml +++ b/templates/drupal-8/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php8.0-fpm:latest @@ -60,7 +60,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -73,16 +73,16 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" memcached: - image: 'memcached:latest' + image: "memcached:latest" networks: - app ports: - - '11211' + - "11211" healthcheck: test: echo "version" | nc -vn -w 1 127.0.0.1 11211 interval: 10s diff --git a/templates/drupal-9/.github/workflows/changelog.yaml b/templates/drupal-9/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-9/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/composer.yaml b/templates/drupal-9/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-9/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/javascript.yaml b/templates/drupal-9/.github/workflows/javascript.yaml new file mode 120000 index 00000000..e76b3a56 --- /dev/null +++ b/templates/drupal-9/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/markdown.yaml b/templates/drupal-9/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-9/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/php.yaml b/templates/drupal-9/.github/workflows/php.yaml new file mode 120000 index 00000000..9367a866 --- /dev/null +++ b/templates/drupal-9/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/php.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/site.yaml b/templates/drupal-9/.github/workflows/site.yaml new file mode 120000 index 00000000..001dbf2c --- /dev/null +++ b/templates/drupal-9/.github/workflows/site.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/site.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/styles.yaml b/templates/drupal-9/.github/workflows/styles.yaml new file mode 120000 index 00000000..b3e30b71 --- /dev/null +++ b/templates/drupal-9/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal/styles.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/twig.yaml b/templates/drupal-9/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-9/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-9/.github/workflows/yaml.yaml b/templates/drupal-9/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-9/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-9/.markdownlint.jsonc b/templates/drupal-9/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-9/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-9/.markdownlintignore b/templates/drupal-9/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-9/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-9/.phpcs.xml.dist b/templates/drupal-9/.phpcs.xml.dist new file mode 120000 index 00000000..17295906 --- /dev/null +++ b/templates/drupal-9/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-9/.twig-cs-fixer.dist.php b/templates/drupal-9/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..7330065d --- /dev/null +++ b/templates/drupal-9/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-9/docker-compose.server.yml b/templates/drupal-9/docker-compose.server.yml index 50770aa3..6dc4546a 100644 --- a/templates/drupal-9/docker-compose.server.yml +++ b/templates/drupal-9/docker-compose.server.yml @@ -52,7 +52,7 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" memcached: - image: 'memcached:latest' + image: "memcached:latest" restart: unless-stopped networks: - app diff --git a/templates/drupal-9/docker-compose.yml b/templates/drupal-9/docker-compose.yml index 839a0b84..f9401dbf 100644 --- a/templates/drupal-9/docker-compose.yml +++ b/templates/drupal-9/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php8.3-fpm:latest @@ -62,7 +62,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -75,16 +75,16 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" memcached: - image: 'memcached:latest' + image: "memcached:latest" networks: - app ports: - - '11211' + - "11211" healthcheck: test: echo "version" | nc -vn -w 1 127.0.0.1 11211 interval: 10s diff --git a/templates/drupal-module/.github/workflows/changelog.yaml b/templates/drupal-module/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/drupal-module/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/composer.yaml b/templates/drupal-module/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/drupal-module/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/javascript.yaml b/templates/drupal-module/.github/workflows/javascript.yaml new file mode 120000 index 00000000..09fb93cd --- /dev/null +++ b/templates/drupal-module/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal-module/javascript.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/markdown.yaml b/templates/drupal-module/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/drupal-module/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/php.yaml b/templates/drupal-module/.github/workflows/php.yaml new file mode 120000 index 00000000..405a1864 --- /dev/null +++ b/templates/drupal-module/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal-module/php.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/styles.yaml b/templates/drupal-module/.github/workflows/styles.yaml new file mode 120000 index 00000000..31ec0309 --- /dev/null +++ b/templates/drupal-module/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/drupal-module/styles.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/twig.yaml b/templates/drupal-module/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/drupal-module/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/drupal-module/.github/workflows/yaml.yaml b/templates/drupal-module/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/drupal-module/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/drupal-module/.markdownlint.jsonc b/templates/drupal-module/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/drupal-module/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/drupal-module/.markdownlintignore b/templates/drupal-module/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/drupal-module/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/drupal-module/.phpcs.xml.dist b/templates/drupal-module/.phpcs.xml.dist new file mode 120000 index 00000000..040c94d1 --- /dev/null +++ b/templates/drupal-module/.phpcs.xml.dist @@ -0,0 +1 @@ +../../config/drupal-module/php/.phpcs.xml.dist \ No newline at end of file diff --git a/templates/drupal-module/.twig-cs-fixer.dist.php b/templates/drupal-module/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..3f9471f4 --- /dev/null +++ b/templates/drupal-module/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/drupal-module/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/drupal-module/docker-compose.yml b/templates/drupal-module/docker-compose.yml new file mode 100644 index 00000000..cb456c10 --- /dev/null +++ b/templates/drupal-module/docker-compose.yml @@ -0,0 +1,19 @@ +# itk-version: 3.2.3 + +services: + phpfpm: + image: itkdev/php8.4-fpm:latest + user: ${COMPOSE_USER:-deploy} + volumes: + - .:/app + + prettier: + # Prettier does not (yet, fcf. + # https://github.com/prettier/prettier/issues/15206) have an official + # docker image. + # https://hub.docker.com/r/jauderho/prettier is good candidate (cf. https://hub.docker.com/search?q=prettier&sort=updated_at&order=desc) + image: jauderho/prettier + profiles: + - dev + volumes: + - ./:/work diff --git a/templates/symfony-3/.github/workflows/changelog.yaml b/templates/symfony-3/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/symfony-3/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/composer.yaml b/templates/symfony-3/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/symfony-3/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/javascript.yaml b/templates/symfony-3/.github/workflows/javascript.yaml new file mode 120000 index 00000000..32f4e115 --- /dev/null +++ b/templates/symfony-3/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/javascript.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/markdown.yaml b/templates/symfony-3/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/symfony-3/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/php.yaml b/templates/symfony-3/.github/workflows/php.yaml new file mode 120000 index 00000000..e5388fe1 --- /dev/null +++ b/templates/symfony-3/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/php.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/styles.yaml b/templates/symfony-3/.github/workflows/styles.yaml new file mode 120000 index 00000000..af396b48 --- /dev/null +++ b/templates/symfony-3/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/styles.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/twig.yaml b/templates/symfony-3/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/symfony-3/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/symfony-3/.github/workflows/yaml.yaml b/templates/symfony-3/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/symfony-3/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/symfony-3/.markdownlint.jsonc b/templates/symfony-3/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/symfony-3/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/symfony-3/.markdownlintignore b/templates/symfony-3/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/symfony-3/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/symfony-3/.php-cs-fixer.dist.php b/templates/symfony-3/.php-cs-fixer.dist.php new file mode 120000 index 00000000..4527ff86 --- /dev/null +++ b/templates/symfony-3/.php-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/php/.php-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-3/.prettierrc.yaml b/templates/symfony-3/.prettierrc.yaml new file mode 120000 index 00000000..eeef7b84 --- /dev/null +++ b/templates/symfony-3/.prettierrc.yaml @@ -0,0 +1 @@ +../../config/symfony/yaml/.prettierrc.yaml \ No newline at end of file diff --git a/templates/symfony-3/.twig-cs-fixer.dist.php b/templates/symfony-3/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..bc68997e --- /dev/null +++ b/templates/symfony-3/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-3/docker-compose.server.yml b/templates/symfony-3/docker-compose.server.yml index 94f7368a..cfe2c112 100644 --- a/templates/symfony-3/docker-compose.server.yml +++ b/templates/symfony-3/docker-compose.server.yml @@ -46,4 +46,3 @@ services: - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" - diff --git a/templates/symfony-3/docker-compose.yml b/templates/symfony-3/docker-compose.yml index e986e846..04a5ae6a 100644 --- a/templates/symfony-3/docker-compose.yml +++ b/templates/symfony-3/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php7.2-fpm:latest @@ -46,7 +46,7 @@ services: - PHP_IDE_CONFIG=serverName=localhost depends_on: mariadb: - condition: service_healthy + condition: service_healthy volumes: - .:/app @@ -58,7 +58,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -71,9 +71,9 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" mail: image: axllent/mailpit diff --git a/templates/symfony-4/.github/workflows/changelog.yaml b/templates/symfony-4/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/symfony-4/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/composer.yaml b/templates/symfony-4/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/symfony-4/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/javascript.yaml b/templates/symfony-4/.github/workflows/javascript.yaml new file mode 120000 index 00000000..32f4e115 --- /dev/null +++ b/templates/symfony-4/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/javascript.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/markdown.yaml b/templates/symfony-4/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/symfony-4/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/php.yaml b/templates/symfony-4/.github/workflows/php.yaml new file mode 120000 index 00000000..e5388fe1 --- /dev/null +++ b/templates/symfony-4/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/php.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/styles.yaml b/templates/symfony-4/.github/workflows/styles.yaml new file mode 120000 index 00000000..af396b48 --- /dev/null +++ b/templates/symfony-4/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/styles.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/twig.yaml b/templates/symfony-4/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/symfony-4/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/symfony-4/.github/workflows/yaml.yaml b/templates/symfony-4/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/symfony-4/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/symfony-4/.markdownlint.jsonc b/templates/symfony-4/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/symfony-4/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/symfony-4/.markdownlintignore b/templates/symfony-4/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/symfony-4/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/symfony-4/.php-cs-fixer.dist.php b/templates/symfony-4/.php-cs-fixer.dist.php new file mode 120000 index 00000000..4527ff86 --- /dev/null +++ b/templates/symfony-4/.php-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/php/.php-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-4/.prettierrc.yaml b/templates/symfony-4/.prettierrc.yaml new file mode 120000 index 00000000..eeef7b84 --- /dev/null +++ b/templates/symfony-4/.prettierrc.yaml @@ -0,0 +1 @@ +../../config/symfony/yaml/.prettierrc.yaml \ No newline at end of file diff --git a/templates/symfony-4/.twig-cs-fixer.dist.php b/templates/symfony-4/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..bc68997e --- /dev/null +++ b/templates/symfony-4/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-4/docker-compose.yml b/templates/symfony-4/docker-compose.yml index d6af9603..c3645644 100644 --- a/templates/symfony-4/docker-compose.yml +++ b/templates/symfony-4/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -27,7 +27,7 @@ services: #- ENCRYPT=1 # Uncomment to enable database encryption. # https://symfony.com/doc/current/setup/symfony_server.html#docker-integration labels: - com.symfony.server.service-prefix: 'DATABASE' + com.symfony.server.service-prefix: "DATABASE" phpfpm: image: itkdev/php7.4-fpm:latest @@ -46,7 +46,7 @@ services: - PHP_IDE_CONFIG=serverName=localhost depends_on: mariadb: - condition: service_healthy + condition: service_healthy volumes: - .:/app @@ -58,7 +58,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -71,9 +71,9 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" mail: image: axllent/mailpit diff --git a/templates/symfony-6/.github/workflows/changelog.yaml b/templates/symfony-6/.github/workflows/changelog.yaml new file mode 120000 index 00000000..5ffe5c3c --- /dev/null +++ b/templates/symfony-6/.github/workflows/changelog.yaml @@ -0,0 +1 @@ +../../../../github/workflows/changelog.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/composer.yaml b/templates/symfony-6/.github/workflows/composer.yaml new file mode 120000 index 00000000..23955648 --- /dev/null +++ b/templates/symfony-6/.github/workflows/composer.yaml @@ -0,0 +1 @@ +../../../../github/workflows/composer.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/javascript.yaml b/templates/symfony-6/.github/workflows/javascript.yaml new file mode 120000 index 00000000..32f4e115 --- /dev/null +++ b/templates/symfony-6/.github/workflows/javascript.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/javascript.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/markdown.yaml b/templates/symfony-6/.github/workflows/markdown.yaml new file mode 120000 index 00000000..ab3eafad --- /dev/null +++ b/templates/symfony-6/.github/workflows/markdown.yaml @@ -0,0 +1 @@ +../../../../github/workflows/markdown.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/php.yaml b/templates/symfony-6/.github/workflows/php.yaml new file mode 120000 index 00000000..e5388fe1 --- /dev/null +++ b/templates/symfony-6/.github/workflows/php.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/php.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/styles.yaml b/templates/symfony-6/.github/workflows/styles.yaml new file mode 120000 index 00000000..af396b48 --- /dev/null +++ b/templates/symfony-6/.github/workflows/styles.yaml @@ -0,0 +1 @@ +../../../../github/workflows/symfony/styles.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/twig.yaml b/templates/symfony-6/.github/workflows/twig.yaml new file mode 120000 index 00000000..649f1cd6 --- /dev/null +++ b/templates/symfony-6/.github/workflows/twig.yaml @@ -0,0 +1 @@ +../../../../github/workflows/twig.yaml \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/yaml.yaml b/templates/symfony-6/.github/workflows/yaml.yaml new file mode 120000 index 00000000..725a7d68 --- /dev/null +++ b/templates/symfony-6/.github/workflows/yaml.yaml @@ -0,0 +1 @@ +../../../../github/workflows/yaml.yaml \ No newline at end of file diff --git a/templates/symfony-6/.markdownlint.jsonc b/templates/symfony-6/.markdownlint.jsonc new file mode 120000 index 00000000..1a3d9afe --- /dev/null +++ b/templates/symfony-6/.markdownlint.jsonc @@ -0,0 +1 @@ +../../config/markdown/.markdownlint.jsonc \ No newline at end of file diff --git a/templates/symfony-6/.markdownlintignore b/templates/symfony-6/.markdownlintignore new file mode 120000 index 00000000..0a61367e --- /dev/null +++ b/templates/symfony-6/.markdownlintignore @@ -0,0 +1 @@ +../../config/markdown/.markdownlintignore \ No newline at end of file diff --git a/templates/symfony-6/.php-cs-fixer.dist.php b/templates/symfony-6/.php-cs-fixer.dist.php new file mode 120000 index 00000000..4527ff86 --- /dev/null +++ b/templates/symfony-6/.php-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/php/.php-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-6/.prettierrc.yaml b/templates/symfony-6/.prettierrc.yaml new file mode 120000 index 00000000..eeef7b84 --- /dev/null +++ b/templates/symfony-6/.prettierrc.yaml @@ -0,0 +1 @@ +../../config/symfony/yaml/.prettierrc.yaml \ No newline at end of file diff --git a/templates/symfony-6/.twig-cs-fixer.dist.php b/templates/symfony-6/.twig-cs-fixer.dist.php new file mode 120000 index 00000000..bc68997e --- /dev/null +++ b/templates/symfony-6/.twig-cs-fixer.dist.php @@ -0,0 +1 @@ +../../config/symfony/twig/.twig-cs-fixer.dist.php \ No newline at end of file diff --git a/templates/symfony-6/docker-compose.yml b/templates/symfony-6/docker-compose.yml index 6edca922..b5c08946 100644 --- a/templates/symfony-6/docker-compose.yml +++ b/templates/symfony-6/docker-compose.yml @@ -12,9 +12,9 @@ services: networks: - app ports: - - '3306' + - "3306" healthcheck: - test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s @@ -55,7 +55,7 @@ services: depends_on: - phpfpm ports: - - '8080' + - "8080" volumes: - ./.docker/templates:/etc/nginx/templates:ro - .:/app @@ -68,9 +68,9 @@ services: - "traefik.enable=true" - "traefik.docker.network=frontend" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)" -# HTTPS config - uncomment to enable redirect from :80 to :443 -# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" -# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + # HTTPS config - uncomment to enable redirect from :80 to :443 + # - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https" + # - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" mail: image: axllent/mailpit diff --git a/traefik/dynamic-conf.yaml b/traefik/dynamic-conf.yaml index c5214327..e87c11cc 100644 --- a/traefik/dynamic-conf.yaml +++ b/traefik/dynamic-conf.yaml @@ -3,7 +3,7 @@ http: ITKMetricsAuth: basicAuth: users: - - 'metrics:$apr1$NN0pEsue$o.K99fyHjlf8XpOh1NA8Y.' + - "metrics:$apr1$NN0pEsue$o.K99fyHjlf8XpOh1NA8Y." tls: certificates: diff --git a/traefik/traefik.yml b/traefik/traefik.yml index 2b7fa5d7..2840741b 100644 --- a/traefik/traefik.yml +++ b/traefik/traefik.yml @@ -1,4 +1,3 @@ - api: dashboard: true insecure: true @@ -10,8 +9,7 @@ entryPoints: https: address: ":443" http: - tls: - {} + tls: {} providers: file: