Skip to content

Commit fb829ac

Browse files
committed
Linted YAML files
1 parent 133456f commit fb829ac

20 files changed

+122
-74
lines changed

.github/workflows/yaml.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/yaml.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### YAML
6+
###
7+
### Validates YAML files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
###
14+
### #### Symfony YAML
15+
###
16+
### Symfony's YAML config files use 4 spaces for indentation and single quotes.
17+
### Therefore we use a [Prettier configuration
18+
### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
19+
### Prettier format YAML files in the `config/` folder like Symfony expects.
20+
21+
name: YAML
22+
23+
on:
24+
pull_request:
25+
push:
26+
branches:
27+
- main
28+
- develop
29+
30+
jobs:
31+
yaml-lint:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- run: |
37+
docker network create frontend
38+
39+
- run: |
40+
docker compose run --rm prettier '**/*.{yml,yaml}' --check

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://taskfile.dev
22

3-
version: '3'
3+
version: "3"
44

55
includes:
66
github-actions: ./task/Taskfile.github-actions.yml

compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ services:
55
- dev
66
volumes:
77
- ./:/md
8+
9+
prettier:
10+
# Prettier does not (yet, fcf.
11+
# https://github.com/prettier/prettier/issues/15206) have an official
12+
# docker image.
13+
# https://hub.docker.com/r/jauderho/prettier is good candidate (cf. https://hub.docker.com/search?q=prettier&sort=updated_at&order=desc)
14+
image: jauderho/prettier
15+
profiles:
16+
- dev
17+
volumes:
18+
- ./:/work

task/Taskfile.github-actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3'
1+
version: "3"
22

33
tasks:
44
documentation:update:
@@ -19,7 +19,7 @@ tasks:
1919
- git diff --exit-code --ignore-blank-lines --ignore-matching-lines='automatically created' '*.md'
2020

2121
documentation:checkout:
22-
desc: 'git checkout all translation file changes if only date metadata is changed'
22+
desc: "git checkout all translation file changes if only date metadata is changed"
2323
cmds:
2424
- git checkout '*.md'
2525
# https://taskfile.dev/reference/schema#precondition

templates/drupal-10/docker-compose.server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ services:
5252
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
5353

5454
memcached:
55-
image: 'memcached:latest'
55+
image: "memcached:latest"
5656
restart: unless-stopped
5757
networks:
5858
- app

templates/drupal-10/docker-compose.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ services:
1212
networks:
1313
- app
1414
ports:
15-
- '3306'
15+
- "3306"
1616
healthcheck:
17-
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
17+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
1818
start_period: 10s
1919
interval: 10s
2020
timeout: 5s
@@ -27,7 +27,7 @@ services:
2727
#- ENCRYPT=1 # Uncomment to enable database encryption.
2828
# https://symfony.com/doc/current/setup/symfony_server.html#docker-integration
2929
labels:
30-
com.symfony.server.service-prefix: 'DATABASE'
30+
com.symfony.server.service-prefix: "DATABASE"
3131

3232
phpfpm:
3333
image: itkdev/php8.3-fpm:latest
@@ -62,7 +62,7 @@ services:
6262
depends_on:
6363
- phpfpm
6464
ports:
65-
- '8080'
65+
- "8080"
6666
volumes:
6767
- ./.docker/templates:/etc/nginx/templates:ro
6868
- .:/app
@@ -75,16 +75,16 @@ services:
7575
- "traefik.enable=true"
7676
- "traefik.docker.network=frontend"
7777
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
78-
# HTTPS config - uncomment to enable redirect from :80 to :443
79-
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
80-
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
78+
# HTTPS config - uncomment to enable redirect from :80 to :443
79+
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
80+
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
8181

8282
memcached:
8383
image: memcached:alpine
8484
networks:
8585
- app
8686
ports:
87-
- '11211'
87+
- "11211"
8888
healthcheck:
8989
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
9090
interval: 10s

templates/drupal-11/docker-compose.server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ services:
5252
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
5353

5454
memcached:
55-
image: 'memcached:latest'
55+
image: "memcached:latest"
5656
restart: unless-stopped
5757
networks:
5858
- app

templates/drupal-11/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ services:
1212
networks:
1313
- app
1414
ports:
15-
- '3306'
15+
- "3306"
1616
healthcheck:
17-
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
17+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
1818
start_period: 10s
1919
interval: 10s
2020
timeout: 5s
@@ -59,7 +59,7 @@ services:
5959
depends_on:
6060
- phpfpm
6161
ports:
62-
- '8080'
62+
- "8080"
6363
volumes:
6464
- ./.docker/templates:/etc/nginx/templates:ro
6565
- .:/app
@@ -81,7 +81,7 @@ services:
8181
networks:
8282
- app
8383
ports:
84-
- '11211'
84+
- "11211"
8585
healthcheck:
8686
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
8787
interval: 10s

templates/drupal-7/docker-compose.server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ services:
5151
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
5252

5353
memcached:
54-
image: 'memcached:latest'
54+
image: "memcached:latest"
5555
restart: unless-stopped
5656
networks:
5757
- app

templates/drupal-7/docker-compose.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ services:
1212
networks:
1313
- app
1414
ports:
15-
- '3306'
15+
- "3306"
1616
healthcheck:
17-
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
17+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
1818
start_period: 10s
1919
interval: 10s
2020
timeout: 5s
@@ -27,7 +27,7 @@ services:
2727
#- ENCRYPT=1 # Uncomment to enable database encryption.
2828
# https://symfony.com/doc/current/setup/symfony_server.html#docker-integration
2929
labels:
30-
com.symfony.server.service-prefix: 'DATABASE'
30+
com.symfony.server.service-prefix: "DATABASE"
3131

3232
phpfpm:
3333
image: itkdev/php7.4-fpm:latest
@@ -61,7 +61,7 @@ services:
6161
depends_on:
6262
- phpfpm
6363
ports:
64-
- '8080'
64+
- "8080"
6565
volumes:
6666
- ./.docker/templates:/etc/nginx/templates:ro
6767
- .:/app
@@ -74,16 +74,16 @@ services:
7474
- "traefik.enable=true"
7575
- "traefik.docker.network=frontend"
7676
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
77-
# HTTPS config - uncomment to enable redirect from :80 to :443
78-
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
79-
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
77+
# HTTPS config - uncomment to enable redirect from :80 to :443
78+
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
79+
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
8080

8181
memcached:
82-
image: 'memcached:latest'
82+
image: "memcached:latest"
8383
networks:
8484
- app
8585
ports:
86-
- '11211'
86+
- "11211"
8787
healthcheck:
8888
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
8989
interval: 10s

0 commit comments

Comments
 (0)