Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 1.22 KB

README.md

File metadata and controls

19 lines (15 loc) · 1.22 KB

DEEP Server

Build Status Maintainability Test Coverage codecov

codecov

Git hooks for pre-commit

Add this to your .git/hooks/pre-commit to generate latest graphql schema before each commit.

#!/bin/sh

echo "pre-commit: Generating graphql schema."
if [ -z `docker ps -q --no-trunc | grep $(docker compose ps -q web)` ]; then
    docker compose run --rm web ./manage.py graphql_schema --out schema.graphql
else
    docker compose exec -T web ./manage.py graphql_schema --out schema.graphql
fi

FYI: If hooks aren't working https://stackoverflow.com/questions/49912695/git-pre-and-post-commit-hooks-not-running