Skip to content

Commit

Permalink
verdaccio host connection refused (facebook#665)
Browse files Browse the repository at this point in the history
* verdaccio host connection refused

* listen to all ports

* update localhost server

* disable waiting step

* master to 62

* node setup

* more verdaccio fixes
  • Loading branch information
HeyImChris authored Dec 4, 2020
1 parent dea0e8e commit 0f36c1c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .ado/ado-start-verdaccio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -ex
THIS_DIR=$PWD

COMMAND="$TMPDIR/launchVerdaccio.command"
echo "cd ${THIS_DIR}; sudo n 10 ; verdaccio --config ./.ado/verdaccio/config.yaml &> ./.ado/verdaccio/console.log" > "$COMMAND"
echo "cd ${THIS_DIR}; verdaccio --config ./.ado/verdaccio/config.yaml &> ./.ado/verdaccio/console.log" > "$COMMAND"
chmod +x "$COMMAND"
open "$COMMAND"
4 changes: 0 additions & 4 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ jobs:
vmImage: $(VmImage)
demands: ['xcode', 'sh', 'npm']
steps:
- task: UseNode@1
inputs:
version: '10.x'

- template: templates/react-native-macos-init.yml
parameters:
configuration: $(configuration)
14 changes: 1 addition & 13 deletions .ado/templates/apple-job-react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@ steps:
rm -rf $(Build.Repository.LocalPath)/DerivedData
displayName: 'Clean DerivedData'
# Install the required components specified in the Brewfile file.
- script: 'brew update'
displayName: 'brew update'

- script: 'brew bundle'
displayName: 'brew bundle'

# Brew can't access user data for node
- script: sudo chown -R $(whoami) /usr/local/*
displayName: 'fix node permissions'

- script: brew link node@12 --overwrite --force
displayName: 'ensure node 12'
- template: apple-node-setup.yml

# Task Group: XCode select proper version
- template: apple-xcode-select.yml
Expand Down
13 changes: 13 additions & 0 deletions .ado/templates/apple-node-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Task Group: Brew install node version
#
steps:
- script: 'brew bundle'
displayName: 'brew bundle'

# Brew can't access user data for node
- script: sudo chown -R $(whoami) /usr/local/*
displayName: 'fix node permissions'

- script: brew link node@12 --overwrite --force
displayName: 'ensure node 12'
10 changes: 3 additions & 7 deletions .ado/templates/react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ steps:
submodules: false # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch

- template: apple-node-setup.yml

# First do a build of the local package, since we point the cli at the local files, it needs to be pre-built
- task: CmdLine@2
displayName: yarn install (local react-native-macos)
Expand All @@ -35,12 +37,6 @@ steps:
script: |
npm install --global verdaccio
- task: CmdLine@2
displayName: Install n used by ado-start-verdaccio.sh
inputs:
script: |
npm install --global n
- task: ShellScript@2
displayName: Launch test npm server (verdaccio)
inputs:
Expand All @@ -63,7 +59,7 @@ steps:
- task: CmdLine@2
displayName: Bump package version
inputs:
script: node scripts/bump-oss-version.js --ci 0.62.1000
script: node scripts/bump-oss-version.js --ci 0.0.1000

- script: |
npm publish --registry http://localhost:4873
Expand Down
2 changes: 1 addition & 1 deletion .ado/waitForVerdaccio.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const path = require('path');

function queryForServerStatus() {

http.get('http://localhost:4873', res => {
http.get('http://0.0.0.0:4873', res => {
console.log(`Server status: ${res.statusCode}`);
if (res.statusCode != 200) {
setTimeout(queryForServerStatus, 2000);
Expand Down

0 comments on commit 0f36c1c

Please sign in to comment.