Skip to content

Commit

Permalink
get rid of all the duplicated configuration values in the CI workflow…
Browse files Browse the repository at this point in the history
… since they're already in the shell scripts
  • Loading branch information
David Herman committed Oct 30, 2023
1 parent 01a1fd3 commit 78d43c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CI

env:
NODE_VERSION: 18.x
CIPROXY: http://127.0.0.1:4873/

on:
push:
Expand Down Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions test/integration/proxy/ci-proxy.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash

CIPROXY=$1

if [ $# -ne 1 ]; then
echo -e 'usage: proxy.sh <url>[:<port>]'
echo -e ' <url> registry server URL'
echo -e ' <port> optional registry server port (default: 80)'
echo -e
echo -e 'error: <url> 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 &
Expand Down
16 changes: 12 additions & 4 deletions test/integration/proxy/local-proxy.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:'
Expand Down

0 comments on commit 78d43c2

Please sign in to comment.