build.sh 693 B

1234567891011121314151617181920212223242526272829
  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. # Build graphql-server customizing DB name
  11. yarn codegen
  12. yarn typegen
  13. echo "Building mappings..."
  14. (cd mappings && yarn build)
  15. echo "Done."
  16. # Copy joy types
  17. cp ./mappings/generated/types/typedefs.json ./mappings/lib/mappings/generated/types/typedefs.json
  18. # We run yarn again to ensure processor and indexer dependencies are installed
  19. # and are inline with root workspace resolutions
  20. yarn
  21. ln -s ../../../../../node_modules/typeorm/cli.js generated/graphql-server/node_modules/.bin/typeorm || :