diff --git a/tasks/e2e-installs.sh b/tasks/e2e-installs.sh index 73ca1c04b15..9d7a0e99daa 100755 --- a/tasks/e2e-installs.sh +++ b/tasks/e2e-installs.sh @@ -15,11 +15,16 @@ cd "$(dirname "$0")" # CLI and app temporary locations # http://unix.stackexchange.com/a/84980 temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` +custom_registry_url=http://localhost:4873 +original_npm_registry_url=`npm get registry` +original_yarn_registry_url=`yarn config get registry` function cleanup { echo 'Cleaning up.' cd "$root_path" rm -rf "$temp_app_path" + npm set registry "$original_npm_registry_url" + yarn config set registry "$original_yarn_registry_url" } # Error messages are redirected to stderr @@ -87,11 +92,11 @@ nohup npx verdaccio@2.7.2 &>$tmp_registry_log & grep -q 'http address' <(tail -f $tmp_registry_log) # Set registry to local registry -npm set registry http://localhost:4873 -yarn config set registry http://localhost:4873 +npm set registry "$custom_registry_url" +yarn config set registry "$custom_registry_url" # Login so we can publish packages -npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r http://localhost:4873 --quotes +npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r "$custom_registry_url" --quotes # Publish the monorepo git clean -f diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index d12a3d645c0..9dc2370dafc 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -16,6 +16,9 @@ cd "$(dirname "$0")" # http://unix.stackexchange.com/a/84980 temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` temp_module_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_module_path'` +custom_registry_url=http://localhost:4873 +original_npm_registry_url=`npm get registry` +original_yarn_registry_url=`yarn config get registry` function cleanup { echo 'Cleaning up.' @@ -23,6 +26,8 @@ function cleanup { cd "$root_path" # TODO: fix "Device or resource busy" and remove ``|| $CI` rm -rf "$temp_app_path" "$temp_module_path" || $CI + npm set registry "$original_npm_registry_url" + yarn config set registry "$original_yarn_registry_url" } # Error messages are redirected to stderr @@ -79,11 +84,11 @@ nohup npx verdaccio@2.7.2 &>$tmp_registry_log & grep -q 'http address' <(tail -f $tmp_registry_log) # Set registry to local registry -npm set registry http://localhost:4873 -yarn config set registry http://localhost:4873 +npm set registry "$custom_registry_url" +yarn config set registry "$custom_registry_url" # Login so we can publish packages -npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r http://localhost:4873 --quotes +npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r "$custom_registry_url" --quotes # Publish the monorepo git clean -f diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 44ee14fb15c..98941f25661 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -15,6 +15,9 @@ cd "$(dirname "$0")" # App temporary location # http://unix.stackexchange.com/a/84980 temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` +custom_registry_url=http://localhost:4873 +original_npm_registry_url=`npm get registry` +original_yarn_registry_url=`yarn config get registry` function cleanup { echo 'Cleaning up.' @@ -22,6 +25,8 @@ function cleanup { # Uncomment when snapshot testing is enabled by default: # rm ./packages/react-scripts/template/src/__snapshots__/App.test.js.snap rm -rf "$temp_app_path" + npm set registry "$original_npm_registry_url" + yarn config set registry "$original_yarn_registry_url" } # Error messages are redirected to stderr @@ -87,11 +92,11 @@ nohup npx verdaccio@2.7.2 &>$tmp_registry_log & grep -q 'http address' <(tail -f $tmp_registry_log) # Set registry to local registry -npm set registry http://localhost:4873 -yarn config set registry http://localhost:4873 +npm set registry "$custom_registry_url" +yarn config set registry "$custom_registry_url" # Login so we can publish packages -npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r http://localhost:4873 --quotes +npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r "$custom_registry_url" --quotes # Lint own code ./node_modules/.bin/eslint --max-warnings 0 packages/babel-preset-react-app/