From a65a22e2044af41ff33cdba4b8fc491aedd2b4ea Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 3 Jan 2023 12:25:23 +0100 Subject: [PATCH] GitHub Actions: move "serve testapp" to commons.sh --- .github/workflows/openvidu-ce-test.yml | 2 ++ ci-scripts/commons.sh | 21 +++++++++++++++++++++ ci-scripts/openvidu-e2e-tests.sh | 8 +------- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/openvidu-ce-test.yml b/.github/workflows/openvidu-ce-test.yml index 4fbb9a51..e01d4d07 100644 --- a/.github/workflows/openvidu-ce-test.yml +++ b/.github/workflows/openvidu-ce-test.yml @@ -95,6 +95,8 @@ jobs: run: ci-scripts/openvidu-e2e-tests.sh --openvidu-server-build - name: Environment launch Kurento run: ci-scripts/openvidu-e2e-tests.sh --environment-launch-kurento + - name: Serve Testapp + run: ci-scripts/commons.sh --serve-openvidu-testapp - name: OpenVidu E2E Tests Kurento run: ci-scripts/openvidu-e2e-tests.sh --openvidu-e2e-tests-kurento - name: Test reports diff --git a/ci-scripts/commons.sh b/ci-scripts/commons.sh index 15f6c466..37393915 100755 --- a/ci-scripts/commons.sh +++ b/ci-scripts/commons.sh @@ -12,6 +12,7 @@ BUILD_OV_NODE_CLIENT=false BUILD_OV_JAVA_CLIENT=false BUILD_OV_PARENT=false BUILD_OV_TESTAPP=false +SERVE_OV_TESTAPP=false # cd to directory if GITHUB_ACTIONS_WORKING_DIR is set if [[ -n "${GITHUB_ACTIONS_WORKING_DIR:-}" ]]; then @@ -51,6 +52,10 @@ if [[ -n ${1:-} ]]; then BUILD_OV_TESTAPP=true shift 1 ;; + --serve-openvidu-testapp ) + SERVE_OV_TESTAPP=true + shift 1 + ;; *) break ;; @@ -232,4 +237,20 @@ if [[ "${BUILD_OV_TESTAPP}" == true || "${EXECUTE_ALL}" == true ]]; then npm link openvidu-browser openvidu-node-client export NG_CLI_ANALYTICS="false" && ./node_modules/@angular/cli/bin/ng.js build --configuration production --output-path=/opt/openvidu/testapp popd +fi + +# ------------- +# Serve OpenVidu TestApp +# ------------- +if [[ "${SERVE_OV_TESTAPP}" == true || "${EXECUTE_ALL}" == true ]]; then + # Generate certificate + openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 \ + -subj "/CN=www.mydom.com/O=My Company LTD./C=US" \ + -keyout /opt/openvidu/testapp/key.pem \ + -out /opt/openvidu/testapp/cert.pem + + # Serve TestApp + pushd /opt/openvidu/testapp + http-server -S -p 4200 &> /opt/openvidu/testapp.log & + popd fi \ No newline at end of file diff --git a/ci-scripts/openvidu-e2e-tests.sh b/ci-scripts/openvidu-e2e-tests.sh index a516ca78..56b76480 100755 --- a/ci-scripts/openvidu-e2e-tests.sh +++ b/ci-scripts/openvidu-e2e-tests.sh @@ -27,13 +27,7 @@ function environmentLaunch { # Kurento and mediasoup needs to run as network host, so we need Docker host IP. local DOCKER_HOST_IP DOCKER_HOST_IP="$(docker network inspect bridge | grep Subnet | cut -d'"' -f4 | cut -d'/' -f1 | sed 's/.$/1/')" - openssl req -newkey rsa:2048 \ - -new -nodes -x509 -days 3650 \ - -subj "/CN=www.mydom.com/O=My Company LTD./C=US" \ - -keyout /opt/openvidu/testapp/key.pem \ - -out /opt/openvidu/testapp/cert.pem - pushd /opt/openvidu/testapp - http-server -S -p 4200 &> /opt/openvidu/testapp.log & + if [[ "${MEDIA_SERVER}" == "kurento" ]]; then docker run -e KMS_UID=$(id -u) --network=host --detach=true --volume=/opt/openvidu/recordings:/opt/openvidu/recordings "${KURENTO_MEDIA_SERVER_IMAGE}" while true; do