start.sh 1.0 KB

1234567891011121314151617181920212223242526
  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. # Bring up db
  8. docker-compose -f ../docker-compose.yml up -d db
  9. # Make sure we use dev config for db migrations (prevents "Cannot create database..." and some other errors)
  10. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node config:dev"
  11. # Migrate the databases
  12. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node-root db:prepare"
  13. docker-compose -f ../docker-compose.yml run --rm --entrypoint sh graphql-server -c "yarn workspace query-node-root db:migrate"
  14. # Start indexer and gateway
  15. docker-compose -f ../docker-compose.yml up -d indexer
  16. docker-compose -f ../docker-compose.yml up -d hydra-indexer-gateway
  17. # Start processor and graphql server
  18. docker-compose -f ../docker-compose.yml up -d processor
  19. docker-compose -f ../docker-compose.yml up -d graphql-server