Use extends syntax

This allows deep merging for config, which is needed for variables`
This commit is contained in:
Jake Howard 2022-08-26 00:03:28 +01:00
parent e0d17394b8
commit 5f4d8828ab
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -55,7 +55,7 @@ container:
- docker build -t website --target production -t $IMAGE_TAG . - docker build -t website --target production -t $IMAGE_TAG .
- docker push $IMAGE_TAG - docker push $IMAGE_TAG
.python_test_template: &python_test_template .python_test_template:
image: python:3.10 image: python:3.10
stage: test stage: test
dependencies: dependencies:
@ -66,6 +66,7 @@ container:
SECRET_KEY: super-secret SECRET_KEY: super-secret
test_python: test_python:
extends: .python_test_template
services: services:
- postgres:13-alpine - postgres:13-alpine
variables: variables:
@ -81,44 +82,43 @@ test_python:
coverage_report: coverage_report:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: coverage.xml
<<: *python_test_template
dependencies: dependencies:
- pip - pip
- static - static
django_checks: django_checks:
<<: *python_test_template extends: .python_test_template
script: script:
- ./manage.py check - ./manage.py check
- ./manage.py makemigrations --check --noinput - ./manage.py makemigrations --check --noinput
black: black:
<<: *python_test_template extends: .python_test_template
script: script:
- black --check . - black --check .
isort: isort:
<<: *python_test_template extends: .python_test_template
script: script:
- isort --check . - isort --check .
flake8: flake8:
<<: *python_test_template extends: .python_test_template
script: script:
- flake8 - flake8
mypy: mypy:
<<: *python_test_template extends: .python_test_template
script: script:
- mypy . - mypy .
curlylint: curlylint:
<<: *python_test_template extends: .python_test_template
script: script:
- curlylint . - curlylint .
djhtml: djhtml:
<<: *python_test_template extends: .python_test_template
script: script:
- git ls-files '*.html' | xargs djhtml --check --tabwidth 2 - git ls-files '*.html' | xargs djhtml --check --tabwidth 2
@ -131,7 +131,7 @@ npm_lint:
- npm run lint - npm run lint
pip_tools: pip_tools:
<<: *python_test_template extends: .python_test_template
script: script:
- ./scripts/compile-requirements.sh - ./scripts/compile-requirements.sh
- git diff - git diff