endtoend-build-ci 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. set -o pipefail
  3. set -o errexit
  4. set -o nounset
  5. set -o xtrace
  6. # Set magic variables for current file & dir
  7. __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  8. __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
  9. __base="$(basename ${__file} .sh)"
  10. __root="$(cd "$(dirname "${__dir}")" && pwd)"
  11. echo "Preparing for end to end test: copying static HTML and CSS, building JS"
  12. rm -rf "${__root}/test/endtoend/dist" && mkdir "${__root}/test/endtoend/dist"
  13. rm -rf "${__root}/test/endtoend/node_modules"
  14. sleep 4
  15. VERDACCIO_REGISTRY=http://localhost:4002
  16. # https://github.com/facebook/create-react-app/pull/4626
  17. (cd && npm-auth-to-token -u user -p password -e user@example.com -r "$VERDACCIO_REGISTRY")
  18. # Simulate a publish of everything, to the local registry,
  19. # without changing things in git
  20. # Use --cd-version to skip version prompts
  21. lerna publish --yes \
  22. --force-publish="*" \
  23. --registry=$VERDACCIO_REGISTRY \
  24. --npm-client=npm \
  25. --skip-git \
  26. --cd-version=prerelease
  27. exit 0
  28. npm run build
  29. cp "${__root}/packages/uppy/dist/uppy.min.css" "${__root}/test/endtoend/dist"
  30. cp "${__root}/test/endtoend/src/index.html" "${__root}/test/endtoend/dist"
  31. browserify "${__root}/test/endtoend/src/main.js" \
  32. -o "${__root}/test/endtoend/dist/bundle.js" \
  33. -t babelify \
  34. -t aliasify
  35. rm -rf "${__root}/test/endtoend/node_modules"