diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a0d0615..8f7d7708 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI env: NODE_VERSION: 18.x - CIPROXY: http://127.0.0.1:4873/ on: push: @@ -54,7 +53,7 @@ jobs: shell: bash working-directory: ./test/integration/proxy timeout-minutes: 3 - run: ./ci-proxy.sh '${{ env.CIPROXY }}' + run: ./ci-proxy.sh - name: Publish to npm Proxy shell: bash working-directory: ./test/integration/proxy diff --git a/test/integration/proxy/ci-proxy.sh b/test/integration/proxy/ci-proxy.sh index 1303c0fc..596f65b8 100755 --- a/test/integration/proxy/ci-proxy.sh +++ b/test/integration/proxy/ci-proxy.sh @@ -1,15 +1,6 @@ #!/bin/bash -CIPROXY=$1 - -if [ $# -ne 1 ]; then - echo -e 'usage: proxy.sh [:]' - echo -e ' registry server URL' - echo -e ' optional registry server port (default: 80)' - echo -e - echo -e 'error: not specified' - exit 1 -fi +CIPROXY=http://127.0.0.1:4873 # Boot the server in a background process. nohup npx verdaccio --config ./config.yml --listen $CIPROXY & diff --git a/test/integration/proxy/local-proxy.sh b/test/integration/proxy/local-proxy.sh index fe0283ca..99bb8383 100755 --- a/test/integration/proxy/local-proxy.sh +++ b/test/integration/proxy/local-proxy.sh @@ -1,5 +1,12 @@ #!/bin/bash +cd $(dirname $0)/../../.. +ROOT_DIR=$(pwd) +PROXY_DIR=${ROOT_DIR}/test/integration/proxy +LOCAL_PROXY=http://127.0.0.1:4873 + +cd ${PROXY_DIR} + if ! which pm2 >/dev/null ; then echo -e 'usage: local-proxy.sh' echo -e @@ -21,15 +28,16 @@ if pm2 describe neon-test-proxy >/dev/null 2>&1 ; then exit 1 fi -rm -rf storage proxy.log +rm -rf ./storage ./proxy.log # Boot the server in a background process. -pm2 start verdaccio --name neon-test-proxy --no-autorestart -- --config ./config.yml --listen http://127.0.0.1:4873 +pm2 start verdaccio --name neon-test-proxy --no-autorestart -- --config ./config.yml --listen ${LOCAL_PROXY} # Wait for the server to begin listening for connections -( tail -F -n10 proxy.log & ) | fgrep -q http://127.0.0.1:4873 +# "${LOCAL_PROXY}" +( tail -F -n10 ./proxy.log & ) | fgrep -q "${LOCAL_PROXY}" -cat proxy.log +cat ./proxy.log echo echo 'Proxy `neon-test-proxy` started. You can now control it using pm2:'