the-deep / server

Server for DEEP
https://app.thedeep.io/
GNU Affero General Public License v3.0
9 stars 3 forks source link

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