Setup API (Hasura) console to version changes in code

This commit is contained in:
Charles Bochet
2023-01-31 19:20:59 +01:00
parent f91f14e72a
commit e72ea96fad
29 changed files with 233 additions and 9 deletions

39
infra/dev/Makefile Normal file
View File

@ -0,0 +1,39 @@
up: ##
@docker-compose up -d
logs: ##
@docker-compose logs $(container) -f
api-sh: ##
@docker-compose exec twenty-api bash
api-console: ##
@docker-compose exec twenty-api bash -c "cd /api; \
socat TCP-LISTEN:8080,fork TCP:twenty-api:8080 & \
socat TCP-LISTEN:9695,fork,reuseaddr,bind=twenty-api TCP:127.0.0.1:9695 & \
socat TCP-LISTEN:9693,fork,reuseaddr,bind=twenty-api TCP:127.0.0.1:9693 & \
hasura console --log-level DEBUG --address "127.0.0.1" --no-browser || exit 1"
api-make-seed: ##
@docker-compose exec twenty-api bash -c "cd /api; \
hasura seeds create seed --from-table $(table)"
api-make-migrations: ##
@docker-compose exec twenty-api bash -c "cd /api; \
hasura migrate create $(name)"
api-make-metadata: ##
@docker-compose exec twenty-api bash -c "cd /api; \
hasura metadata export"
front-sh: ##
@docker-compose exec twenty-front bash
front-test: ##
@docker-compose exec twenty-front sh -c "npm run test"
front-coverage: ##
@docker-compose exec twenty-front sh -c "npm run coverage"
front-storybook: ##
@docker-compose exec twenty-front sh -c "npm run storybook"

View File

@ -24,12 +24,16 @@ services:
build: ./twenty-api
ports:
- "8080:8080"
- "9695:9695"
- "9693:9693"
volumes:
- ../../api:/api
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/hasura
PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/twenty
HASURA_GRAPHQL_PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/twenty
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}

View File

@ -1,3 +1,9 @@
FROM hasura/graphql-engine:latest as api
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y socat
RUN apt-get install -y vim
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
CMD ["sh", "-c", "graphql-engine serve"]

View File

@ -1,3 +1,7 @@
FROM hasura/graphql-engine:latest as api
RUN apt-get update
RUN apt-get install -y curl
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
CMD ["sh", "-c", "graphql-engine serve"]