start.sh 990 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. # Only run codegen if no generated files found
  6. [ ! -d "generated/" ] && yarn build
  7. # Make sure we use dev config for db migrations (prevents "Cannot create database..." and some other errors)
  8. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node config:dev"
  9. # Migrate the databases
  10. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node-root db:prepare"
  11. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node-root db:migrate"
  12. # Start indexer and gateway
  13. docker-compose -f ../docker-compose.yml up -d indexer
  14. docker-compose -f ../docker-compose.yml up -d hydra-indexer-gateway
  15. # Start processor and graphql server
  16. docker-compose -f ../docker-compose.yml up -d processor
  17. docker-compose -f ../docker-compose.yml up -d graphql-server