123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #!/usr/bin/env bash
- set -o pipefail
- set -o errexit
- set -o nounset
- set -o xtrace
- # Set magic variables for current file & dir
- __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
- __base="$(basename ${__file} .sh)"
- __root="$(cd "$(dirname "${__dir}")" && pwd)"
- VERDACCIO_REGISTRY=http://localhost:4002
- cleanup() {
- rm -rf "${__root}/test/endtoend/node_modules"
- rm -rf "${__root}/test/endtoend/tmp"
- }
- echo "Preparing for end to end test: copying static HTML and CSS, building JS"
- rm -rf "${__root}/test/endtoend/node_modules"
- PACKAGES="$(for pkg in packages/@uppy/*; do echo "${pkg#packages/}"; done)"
- cleanup
- npm run build
- # https://github.com/facebook/create-react-app/pull/4626
- (cd && npm-auth-to-token -u user -p password -e user@example.com -r "$VERDACCIO_REGISTRY")
- # Simulate a publish of everything, to the local registry,
- # without changing things in git
- # Use --cd-version to skip version prompts
- lerna publish --yes \
- --force-publish \
- --registry="$VERDACCIO_REGISTRY" \
- --npm-client=npm \
- --no-git-tag-version --no-push \
- --canary
- # revert version changes
- git checkout -- packages/*/package.json packages/@uppy/*/package.json
- # install all packages to the endtoend folder
- # (Don't use the npm cache, don't generate a package-lock, don't save dependencies to any package.json)
- (cd "${__root}/test/endtoend" && npm install --prefer-online --registry "$VERDACCIO_REGISTRY" --no-package-lock --no-save uppy $PACKAGES)
- bash "${__dir}/endtoend-build-tests"
- cleanup
|