From 6af98baba7fe7079571fe2f84a2a146888a2982b Mon Sep 17 00:00:00 2001 From: barshaul Date: Sat, 29 Jun 2024 17:49:58 +0000 Subject: [PATCH] Removed all symlink specific checks --- .github/workflows/compare-versions/action.yml | 53 ------------------- .github/workflows/install-valkey/action.yml | 29 +--------- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/compare-versions/action.yml diff --git a/.github/workflows/compare-versions/action.yml b/.github/workflows/compare-versions/action.yml deleted file mode 100644 index 26d84b5ab3..0000000000 --- a/.github/workflows/compare-versions/action.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: 'Compare Versions' -description: 'Compares two versions to determine if version1 is greater than or equal to version2' -inputs: - version1: - description: 'The first version to compare' - required: true - version2: - description: 'The second version to compare' - required: true -outputs: - result: - description: 'True if version1 is greater than or equal to version2, false otherwise' -runs: - using: 'composite' - steps: - - run: | - # Function to normalize the version string to "x.y.z" format - normalize_version() { - local version=$1 - # Remove any prefix like "redis-" - version=$(echo "$version" | sed 's/^redis-//') - # Append ".0" if it's in "x.y" format - if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - version="$version.0" - fi - echo "$version" - } - - # Function to compare two versions - compare_versions() { - local v1=$(normalize_version "$1") - local v2=$(normalize_version "$2") - - # Split the versions into parts - IFS='.' read -r -a v1_parts <<< "$v1" - IFS='.' read -r -a v2_parts <<< "$v2" - - for i in {0..2}; do - if [[ ${v1_parts[$i]} -gt ${v2_parts[$i]} ]]; then - echo "true" - return - elif [[ ${v1_parts[$i]} -lt ${v2_parts[$i]} ]]; then - echo "false" - return - fi - done - echo "true" - } - - result=$(compare_versions "${{ inputs.version1 }}" "${{ inputs.version2 }}") - echo "comparison result=$result" - echo "result=$result" >> $GITHUB_OUTPUT - shell: bash diff --git a/.github/workflows/install-valkey/action.yml b/.github/workflows/install-valkey/action.yml index 8db9c2bbdd..f15a875c03 100644 --- a/.github/workflows/install-valkey/action.yml +++ b/.github/workflows/install-valkey/action.yml @@ -61,40 +61,15 @@ runs: fi echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile - - name: Check if the current version is a Valkey release - id: is_valkey_release - uses: ./.github/workflows/compare-versions - with: - # Checks if the current tested version is a Valkey release (>= 7.2.5) - version1: ${{ inputs.engine-version }} - version2: ${{ env.VALKEY_MIN_VERSION }} - - name: Verify Valkey installation and symlinks shell: bash run: | # In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli # to redis-server and redis-cli. This step ensures that the engine is properly installed # with the expected version and that Valkey symlinks are correctly created. - - IS_VALKEY=${{ steps.is_valkey_release.outputs.result }} EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"` - REDIS_SERVER_VER=$(redis-server -v) - if [[ $IS_VALKEY == "true" ]]; then - echo "Is a Valkey version" - # Prior to the minimum Valkey version, only redis-server is installed - VALKEY_SERVER_VER=$(valkey-server -v) - INSTALLED_VER=$VALKEY_SERVER_VER - else - echo "Isn't a Valkey version" - INSTALLED_VER=$REDIS_SERVER_VER - fi - - if [[ $IS_VALKEY == true ]] && [[ $VALKEY_SERVER_VER != $REDIS_SERVER_VER ]]; then - echo $'Symlink from valkey to redis failed.' \ - $'\nvalkey: '"$VALKEY_SERVER_VER"$', path:'"$(which valkey-server)" \ - $'\nredis: '"$REDIS_SERVER_VER"$', path:'"$(which redis-server)" - exit 1 - elif [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then + INSTALLED_VER=$(redis-server -v) + if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER" exit 1 else