build.sh 986 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. # Load and export variables from root .env file into shell environment
  6. set -a
  7. . ../.env
  8. set +a
  9. yarn clean
  10. # We generate the code for each service separately to be able to specify
  11. # separate database names.
  12. # Build graphql-server customizing DB name
  13. DB_NAME=${PROCESSOR_DB_NAME} yarn codegen:server
  14. # We run yarn again to ensure processor and indexer dependencies are installed
  15. # and are inline with root workspace resolutions
  16. yarn
  17. ln -s ../../../../../node_modules/typeorm/cli.js generated/graphql-server/node_modules/.bin/typeorm || :
  18. yarn tsc --build tsconfig.json
  19. # NOTE: hydra-processor will be updated! if it fail which means it is not updated yet so please manually edit
  20. # generated/hydra-processor/tsconfig.json by update hydra-processor tsconfig file by setting include = ["index.js"] and root="."
  21. (cd ./generated/hydra-processor && rm -rf lib && yarn tsc --build tsconfig.json)