runtime-code-shasum.sh 794 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. # Compute a hash over files related to building joystream/node docker image
  3. # Cargo workspace root
  4. export WORKSPACE_ROOT=`cargo metadata --offline --no-deps --format-version 1 | jq .workspace_root -r`
  5. cd ${WORKSPACE_ROOT}
  6. TAR=tar
  7. SED=sed
  8. if [[ "$OSTYPE" == "darwin"* ]]; then
  9. TAR=gtar
  10. SED=gsed
  11. fi
  12. # sort/owner/group/mtime arguments only work with gnu version of tar!
  13. ${TAR} -c --sort=name --owner=root:0 --group=root:0 --mode 644 --mtime='UTC 2020-01-01' \
  14. Cargo.lock \
  15. Cargo.toml \
  16. runtime \
  17. runtime-modules \
  18. utils/chain-spec-builder \
  19. joystream-node.Dockerfile \
  20. joystream-node-armv7.Dockerfile \
  21. node \
  22. | if [[ -n "$RUNTIME_PROFILE" ]]; then ${SED} '$a'"$RUNTIME_PROFILE"; else tee; fi \
  23. | shasum \
  24. | cut -d " " -f 1