From a14f8d997d8c14dec09eb300fb47bbf640f5bf59 Mon Sep 17 00:00:00 2001 From: cruizba Date: Sat, 14 Oct 2023 23:02:56 +0200 Subject: [PATCH] openvidu-ci: move check kurento of snapshots from test-utils.sh to build.sh. Remove config of openvidu generic settings in bump --- .github/workflows/openvidu-ce-test.yml | 2 +- ci-scripts/commons/build.sh | 25 +++++++++++++++++++++++++ ci-scripts/commons/bump.sh | 12 +----------- ci-scripts/commons/test-utils.sh | 21 --------------------- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/.github/workflows/openvidu-ce-test.yml b/.github/workflows/openvidu-ce-test.yml index 5c623b0c..c9f52963 100644 --- a/.github/workflows/openvidu-ce-test.yml +++ b/.github/workflows/openvidu-ce-test.yml @@ -71,7 +71,7 @@ jobs: - name: Prepare test environment run: /opt/test-utils.sh --prepare-test-environment "${TEST_IMAGE}" - name: Check and prepare kurento snapshots - run: /opt/test-utils.sh --check-and-prepare-kurento-snapshot + run: /opt/build.sh --check-and-prepare-kurento-snapshot - name: Use specific kurento-java commit if: ${{ env.KURENTO_JAVA_COMMIT != 'default'}} run: /opt/test-utils.sh --use-specific-kurento-java-commit diff --git a/ci-scripts/commons/build.sh b/ci-scripts/commons/build.sh index 2b26418f..0f5fd083 100644 --- a/ci-scripts/commons/build.sh +++ b/ci-scripts/commons/build.sh @@ -17,6 +17,7 @@ BUILD_OV_SERVER=false BUILD_OV_SERVER_DEPENDENCY=false BUILD_OV_SERVER_PRO_INSPECTOR=false BUILD_OV_SERVER_PRO=false +CHECK_AND_PREPARE_KURENTO_SNAPSHOT=false if [[ -n ${1:-} ]]; then case "${1:-}" in @@ -74,6 +75,9 @@ if [[ -n ${1:-} ]]; then --build-openvidu-server-pro) BUILD_OV_SERVER_PRO=true ;; + --check-and-prepare-kurento-snapshot) + CHECK_AND_PREPARE_KURENTO_SNAPSHOT=true + ;; *) echo "Unrecognized method $1" @@ -221,3 +225,24 @@ if [[ "${BUILD_OV_SERVER_PRO}" == true ]]; then mv target/openvidu-server-pro-*.jar /opt/openvidu popd fi + +# ------------- +# Check kurento version from pom.xml +# If kurento version is a snapshot, configure snapshot builds +# ------------- +if [[ "${CHECK_AND_PREPARE_KURENTO_SNAPSHOT}" == true ]]; then + # Check if kurento version is a snapshot + KURENTO_VERSION=$(awk -F'[<>]' '// {print $3}' pom.xml) + if [[ "${KURENTO_VERSION}" == *"-SNAPSHOT" ]] && [[ -n "${KURENTO_SNAPSHOTS_URL:-}" ]]; then + echo "Kurento version is a SNAPSHOT: ${KURENTO_VERSION}" + sudo mkdir -p /etc/maven + sudo chmod -R 777 /etc/maven + pushd /etc/maven + rm -f settings.xml + curl https://raw.githubusercontent.com/OpenVidu/openvidu/master/ci-scripts/kurento-snapshots.xml -o settings.xml + sed -i "s|KURENTO_SNAPSHOTS_URL|${KURENTO_SNAPSHOTS_URL}|g" settings.xml + popd + else + echo "Kurento version is not a SNAPSHOT: ${KURENTO_VERSION}" + fi +fi diff --git a/ci-scripts/commons/bump.sh b/ci-scripts/commons/bump.sh index 4584d6c8..63651266 100644 --- a/ci-scripts/commons/bump.sh +++ b/ci-scripts/commons/bump.sh @@ -239,17 +239,7 @@ fi # Bump Maven project property # ------------- if [[ "${BUMP_MAVEN_PROPERTY_VERSION}" == true ]]; then - - MVN_SETTINGS_FLAG="" - - if [[ -n "${OPENVIDU_MAVEN_GENERIC_SETTINGS:-}" ]]; then - # Config file with Kurento Snapshots configuration only - mkdir -p /tmp/maven-generic-settings - echo "${OPENVIDU_MAVEN_GENERIC_SETTINGS}" >/tmp/maven-generic-settings/settings.xml - MVN_SETTINGS_FLAG='--settings /tmp/maven-generic-settings/settings.xml' - fi - - mvn --batch-mode $MVN_SETTINGS_FLAG \ + mvn --batch-mode \ -DskipTests=true \ versions:set-property \ -Dproperty="${PROPERTY}" \ diff --git a/ci-scripts/commons/test-utils.sh b/ci-scripts/commons/test-utils.sh index f370ccf0..bd122077 100644 --- a/ci-scripts/commons/test-utils.sh +++ b/ci-scripts/commons/test-utils.sh @@ -126,27 +126,6 @@ if [[ "${PREPARE_TEST_ENVIRONMENT}" == true ]]; then fi -# ------------- -# Check kurento version from pom.xml -# If kurento version is a snapshot, configure snapshot builds -# ------------- -if [[ "${CHECK_AND_PREPARE_KURENTO_SNAPSHOT}" == true ]]; then - # Check if kurento version is a snapshot - KURENTO_VERSION=$(awk -F'[<>]' '// {print $3}' pom.xml) - if [[ "${KURENTO_VERSION}" == *"-SNAPSHOT" ]] && [[ -n "${KURENTO_SNAPSHOTS_URL:-}" ]]; then - echo "Kurento version is a SNAPSHOT: ${KURENTO_VERSION}" - sudo mkdir -p /etc/maven - sudo chmod -R 777 /etc/maven - pushd /etc/maven - rm -f settings.xml - curl https://raw.githubusercontent.com/OpenVidu/openvidu/master/ci-scripts/kurento-snapshots.xml -o settings.xml - sed -i "s|KURENTO_SNAPSHOTS_URL|${KURENTO_SNAPSHOTS_URL}|g" settings.xml - popd - else - echo "Kurento version is not a SNAPSHOT: ${KURENTO_VERSION}" - fi -fi - # ------------- # Use a specific kurento-java commit other than the configured in openvidu-parent pom.xml # -------------