package.sh 701 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. set -e
  3. if [ -n "$DIST_VERSION" ]; then
  4. version=$DIST_VERSION
  5. else
  6. version=`git describe --dirty --tags || echo unknown`
  7. fi
  8. yarn clean
  9. VERSION=$version yarn build
  10. # include the sample config in the tarball. Arguably this should be done by
  11. # `yarn build`, but it's just too painful.
  12. cp config.sample.json webapp/
  13. mkdir -p dist
  14. cp -r webapp element-$version
  15. # Just in case you have a local config, remove it before packaging
  16. rm element-$version/config.json || true
  17. $(dirname $0)/normalize-version.sh ${version} > element-$version/version
  18. tar chvzf dist/element-$version.tar.gz element-$version
  19. rm -r element-$version
  20. echo
  21. echo "Packaged dist/element-$version.tar.gz"