From 9a961978d8df3571168b4e7e17c9a7222234f1c8 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:15:37 -0700 Subject: [PATCH 1/9] test error case --- linux/action.yaml | 6 ------ linux/install-senzing.sh | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/linux/action.yaml b/linux/action.yaml index fcb6950..c2ac0ee 100644 --- a/linux/action.yaml +++ b/linux/action.yaml @@ -20,12 +20,6 @@ runs: shell: bash run: ${{ github.action_path }}/install-senzing.sh - # Verify installation. - - - name: Verify installed Senzing API Runtime version - shell: bash - run: cat /opt/senzing/er/szBuildVersion.json - branding: icon: download color: green diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index 0f6e58d..df60b3b 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -158,6 +158,26 @@ install-senzingapi-runtime() { } +############################################ +# verify-installation +# GLOBALS: +# SENZING_PACKAGE +# full package name used for install +############################################ +verify-installation() { + + echo "[INFO] verify senzing installation" + is-major-version-greater-than-3 && BUILD_VERSION_PATH="g2/g2BuildVersion" || BUILD_VERSION_PATH="er/szBuildVersion" + # is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" + if [ ! -f /opt/senzing/"$BUILD_VERSION_PATH".json ]; then + echo "[ERROR] /opt/senzing/$BUILD_VERSION_PATH.json not found." + exit 1 + else + cat /opt/senzing/"$BUILD_VERSION_PATH".json + fi + +} + ############################################ # Main ############################################ @@ -165,4 +185,5 @@ install-senzingapi-runtime() { echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" configure-vars install-senzing-repository -install-senzingapi-runtime \ No newline at end of file +install-senzingapi-runtime +verify-installation \ No newline at end of file From 40b9d5282e3a53947382772bbe482b2f29cf9e14 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:16:46 -0700 Subject: [PATCH 2/9] update branch --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index daaa8fb..e52108f 100644 --- a/action.yaml +++ b/action.yaml @@ -12,7 +12,7 @@ runs: steps: - if: runner.os == 'Linux' name: Run on Linux - uses: senzing-factory/github-action-install-senzing-api/linux@v3 + uses: senzing-factory/github-action-install-senzing-api/linux@69-skern with: senzingapi-runtime-version: ${{ inputs.senzingapi-runtime-version }} From e0cfe7a9e409c147ec4d91688a25fd9aea67a28d Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:19:55 -0700 Subject: [PATCH 3/9] cleanup test --- linux/install-senzing.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index df60b3b..c928e78 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -167,12 +167,12 @@ install-senzingapi-runtime() { verify-installation() { echo "[INFO] verify senzing installation" - is-major-version-greater-than-3 && BUILD_VERSION_PATH="g2/g2BuildVersion" || BUILD_VERSION_PATH="er/szBuildVersion" - # is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" + is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" if [ ! -f /opt/senzing/"$BUILD_VERSION_PATH".json ]; then echo "[ERROR] /opt/senzing/$BUILD_VERSION_PATH.json not found." exit 1 else + echo "[INFO] cat /opt/senzing/$BUILD_VERSION_PATH.json" cat /opt/senzing/"$BUILD_VERSION_PATH".json fi From c77df2384dbf660b225d8c28040263ab9eda04c8 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:38:22 -0700 Subject: [PATCH 4/9] update osx and win senzing paths to support v3 and v4 --- action.yaml | 4 +-- darwin/action.yaml | 20 ++--------- darwin/download-senzing.sh | 71 ------------------------------------- linux/install-senzing.sh | 6 ++-- windows/action.yaml | 19 ++-------- windows/download-senzing.sh | 71 ------------------------------------- 6 files changed, 10 insertions(+), 181 deletions(-) delete mode 100755 darwin/download-senzing.sh delete mode 100755 windows/download-senzing.sh diff --git a/action.yaml b/action.yaml index e52108f..4d0c7af 100644 --- a/action.yaml +++ b/action.yaml @@ -18,13 +18,13 @@ runs: - if: runner.os == 'macOS' name: Run on macOS - uses: senzing-factory/github-action-install-senzing-api/darwin@v3 + uses: senzing-factory/github-action-install-senzing-api/darwin@69-skern with: senzingapi-version: ${{ inputs.senzingapi-version }} - if: runner.os == 'Windows' name: Run on Windows - uses: senzing-factory/github-action-install-senzing-api/windows@v3 + uses: senzing-factory/github-action-install-senzing-api/windows@69-skern with: senzingapi-version: ${{ inputs.senzingapi-version }} diff --git a/darwin/action.yaml b/darwin/action.yaml index 80ffe32..4c141e3 100644 --- a/darwin/action.yaml +++ b/darwin/action.yaml @@ -11,29 +11,13 @@ runs: using: composite steps: - # Download latest staging or production image. + # Install latest staging or production image. - env: SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }} name: Install Senzing API shell: bash - run: ${{ github.action_path }}/download-senzing.sh - - # Install Senzing API. - - - name: Install Senzing API - shell: bash - run: | - ls -tlc /tmp/ - hdiutil attach /tmp/senzingapi.dmg - sudo mkdir -p /opt/senzing/ - sudo cp -R /Volumes/SenzingAPI/senzing/er /opt/senzing - - # Verify installation. - - - name: Verify installed Senzing API version - shell: bash - run: cat /opt/senzing/er/szBuildVersion.json + run: ${{ github.action_path }}/install-senzing.sh branding: icon: download diff --git a/darwin/download-senzing.sh b/darwin/download-senzing.sh deleted file mode 100755 index 68fc9d7..0000000 --- a/darwin/download-senzing.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -e - -############################################ -# configure-vars -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -############################################ -configure-vars() { - - if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then - - echo "[INFO] install senzingapi from production" - SENZINGAPI_URI="s3://public-read-access/MacOS_API/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/MacOS_API" - - elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then - - echo "[INFO] install senzingapi from staging" - SENZINGAPI_URI="s3://public-read-access/staging/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" - - else - echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" - exit 1 - fi - -} - -############################################ -# determine-latest-dmg-for-major-version -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -# SENZINGAPI_URI -############################################ -determine-latest-dmg-for-major-version() { - - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" - - aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request | grep -o -E '[^ ]+.dmg$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') - rm /tmp/staging-versions - echo "[INFO] latest staging version is: $latest_staging_version" - - SENZINGAPI_DMG_URL="$SENZINGAPI_URL$latest_staging_version" - -} - -############################################ -# download-dmg -# GLOBALS: -# SENZINGAPI_DMG_URL -############################################ -download-dmg() { - - echo "[INFO] curl --output /tmp/senzingapi.dmg $SENZINGAPI_DMG_URL" - curl --output /tmp/senzingapi.dmg "$SENZINGAPI_DMG_URL" - -} - -############################################ -# Main -############################################ - -echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" -configure-vars -determine-latest-dmg-for-major-version -download-dmg diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index c928e78..bcb125a 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -161,8 +161,10 @@ install-senzingapi-runtime() { ############################################ # verify-installation # GLOBALS: -# SENZING_PACKAGE -# full package name used for install +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version ############################################ verify-installation() { diff --git a/windows/action.yaml b/windows/action.yaml index 53446c3..d142d92 100644 --- a/windows/action.yaml +++ b/windows/action.yaml @@ -12,28 +12,13 @@ runs: using: composite steps: - # Download latest staging or production image. + # Install latest staging or production image. - env: SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }} name: Install Senzing API shell: bash - run: $GITHUB_ACTION_PATH/download-senzing.sh - - # Install Senzing API. - - - name: Install Senzing API - shell: cmd - run: | - 7z x -y -o"C:\Program Files" senzingapi.zip - ren "C:\Program Files\senzing" "senzing2" - ren "C:\Program Files\senzing2" "Senzing" - - # Verify installation. - - - name: Verify installed Senzing API version - shell: bash - run: cat "/c/Program Files\senzing\er\szBuildVersion.json" + run: $GITHUB_ACTION_PATH/install-senzing.sh branding: icon: download diff --git a/windows/download-senzing.sh b/windows/download-senzing.sh deleted file mode 100755 index f694661..0000000 --- a/windows/download-senzing.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -e - -############################################ -# configure-vars -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -############################################ -configure-vars() { - - if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then - - echo "[INFO] install senzingapi from production" - SENZINGAPI_URI="s3://public-read-access/Windows_API/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/Windows_API" - - elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then - - echo "[INFO] install senzingapi from staging" - SENZINGAPI_URI="s3://public-read-access/staging/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" - - else - echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" - exit 1 - fi - -} - -############################################ -# determine-latest-zip-for-major-version -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -# SENZINGAPI_URI -############################################ -determine-latest-zip-for-major-version() { - - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" - - aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request --region us-east-1 | grep -o -E '[^ ]+.zip$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') - rm /tmp/staging-versions - echo "[INFO] latest staging version is: $latest_staging_version" - - SENZINGAPI_ZIP_URL="$SENZINGAPI_URL$latest_staging_version" - -} - -############################################ -# download-zip -# GLOBALS: -# SENZINGAPI_ZIP_URL -############################################ -download-zip() { - - echo "[INFO] curl --output senzingapi.zip $SENZINGAPI_ZIP_URL" - curl --output senzingapi.zip "$SENZINGAPI_ZIP_URL" - -} - -############################################ -# Main -############################################ - -echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" -configure-vars -determine-latest-zip-for-major-version -download-zip From d9c57ee7663783a1e4078ece3a4b6303c58ced97 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:45:57 -0700 Subject: [PATCH 5/9] add renamed files --- darwin/install-senzing.sh | 113 +++++++++++++++++++++++++++++++++++++ windows/install-senzing.sh | 107 +++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100755 darwin/install-senzing.sh create mode 100755 windows/install-senzing.sh diff --git a/darwin/install-senzing.sh b/darwin/install-senzing.sh new file mode 100755 index 0000000..b821388 --- /dev/null +++ b/darwin/install-senzing.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +set -e + +############################################ +# configure-vars +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +############################################ +configure-vars() { + + if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then + + echo "[INFO] install senzingapi from production" + SENZINGAPI_URI="s3://public-read-access/MacOS_API/" + SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/MacOS_API" + + elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then + + echo "[INFO] install senzingapi from staging" + SENZINGAPI_URI="s3://public-read-access/staging/" + SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" + + else + echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" + exit 1 + fi + +} + +############################################ +# determine-latest-dmg-for-major-version +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +# SENZINGAPI_URI +############################################ +determine-latest-dmg-for-major-version() { + + major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') + echo "[INFO] major version is: $major_version" + + aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request | grep -o -E '[^ ]+.dmg$' > /tmp/staging-versions + latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') + rm /tmp/staging-versions + echo "[INFO] latest staging version is: $latest_staging_version" + + SENZINGAPI_DMG_URL="$SENZINGAPI_URL$latest_staging_version" + +} + +############################################ +# download-dmg +# GLOBALS: +# SENZINGAPI_DMG_URL +############################################ +download-dmg() { + + echo "[INFO] curl --output /tmp/senzingapi.dmg $SENZINGAPI_DMG_URL" + curl --output /tmp/senzingapi.dmg "$SENZINGAPI_DMG_URL" + +} + +############################################ +# install-senzing +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version +############################################ +install-senzing() { + + ls -tlc /tmp/ + hdiutil attach /tmp/senzingapi.dmg + sudo mkdir -p /opt/senzing/ + is-major-version-greater-than-3 && SENZING_PATH="er" || SENZING_PATH="g2" + sudo cp -R /Volumes/SenzingAPI/senzing/"$SENZING_PATH" /opt/senzing + +} + +############################################ +# verify-installation +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version +############################################ +verify-installation() { + + echo "[INFO] verify senzing installation" + is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" + if [ ! -f /opt/senzing/"$BUILD_VERSION_PATH".json ]; then + echo "[ERROR] /opt/senzing/$BUILD_VERSION_PATH.json not found." + exit 1 + else + echo "[INFO] cat /opt/senzing/$BUILD_VERSION_PATH.json" + cat /opt/senzing/"$BUILD_VERSION_PATH".json + fi + +} + +############################################ +# Main +############################################ + +echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" +configure-vars +determine-latest-dmg-for-major-version +download-dmg +install-senzing +verify-installation diff --git a/windows/install-senzing.sh b/windows/install-senzing.sh new file mode 100755 index 0000000..e390c7d --- /dev/null +++ b/windows/install-senzing.sh @@ -0,0 +1,107 @@ +#!/usr/bin/env bash +set -e + +############################################ +# configure-vars +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +############################################ +configure-vars() { + + if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then + + echo "[INFO] install senzingapi from production" + SENZINGAPI_URI="s3://public-read-access/Windows_API/" + SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/Windows_API" + + elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then + + echo "[INFO] install senzingapi from staging" + SENZINGAPI_URI="s3://public-read-access/staging/" + SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" + + else + echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" + exit 1 + fi + +} + +############################################ +# determine-latest-zip-for-major-version +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +# SENZINGAPI_URI +############################################ +determine-latest-zip-for-major-version() { + + major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') + echo "[INFO] major version is: $major_version" + + aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request --region us-east-1 | grep -o -E '[^ ]+.zip$' > /tmp/staging-versions + latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') + rm /tmp/staging-versions + echo "[INFO] latest staging version is: $latest_staging_version" + + SENZINGAPI_ZIP_URL="$SENZINGAPI_URL$latest_staging_version" + +} + +############################################ +# download-zip +# GLOBALS: +# SENZINGAPI_ZIP_URL +############################################ +download-zip() { + + echo "[INFO] curl --output senzingapi.zip $SENZINGAPI_ZIP_URL" + curl --output senzingapi.zip "$SENZINGAPI_ZIP_URL" + +} + + +############################################ +# install-senzing +############################################ +install-senzing() { + + 7z x -y -o"C:\Program Files" senzingapi.zip + ren "C:\Program Files\senzing" "senzing2" + ren "C:\Program Files\senzing2" "Senzing" + +} + +############################################ +# verify-installation +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version +############################################ +verify-installation() { + + echo "[INFO] verify senzing installation" + is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" + if [ ! -f /c/Program Files/senzing/"$BUILD_VERSION_PATH".json ]; then + echo "[ERROR] /c/Program Files/senzing/$BUILD_VERSION_PATH.json not found." + exit 1 + else + echo "[INFO] cat /c/Program Files/senzing/$BUILD_VERSION_PATH.json" + cat "/c/Program Files/senzing/$BUILD_VERSION_PATH.json" + fi + +} + +############################################ +# Main +############################################ + +echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" +configure-vars +determine-latest-zip-for-major-version +download-zip +install-senzing +verify-installation From 698ca3510b4afa30d7dc1c6ee3a7f8444fc29f8a Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:14:21 -0700 Subject: [PATCH 6/9] cleanup, add missing functions --- darwin/install-senzing.sh | 37 ++++++++++++++++++++++++++++++++--- linux/install-senzing.sh | 36 +++++++++++++++++----------------- windows/install-senzing.sh | 40 +++++++++++++++++++++++++++++++++----- 3 files changed, 87 insertions(+), 26 deletions(-) diff --git a/darwin/install-senzing.sh b/darwin/install-senzing.sh index b821388..91f30bb 100755 --- a/darwin/install-senzing.sh +++ b/darwin/install-senzing.sh @@ -28,6 +28,38 @@ configure-vars() { } +############################################ +# get-generic-major-version +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +# semver does not apply here +############################################ +get-generic-major-version(){ + + MAJOR_VERSION=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') + echo "[INFO] major version is: $MAJOR_VERSION" + export MAJOR_VERSION + +} + +############################################ +# is-major-version-greater-than-3 +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via +# get-generic-major-version +############################################ +is-major-version-greater-than-3() { + + if [[ $MAJOR_VERSION -gt 3 ]]; then + return 0 + else + return 1 + fi + +} + ############################################ # determine-latest-dmg-for-major-version # GLOBALS: @@ -37,11 +69,10 @@ configure-vars() { ############################################ determine-latest-dmg-for-major-version() { - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" + get-generic-major-version aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request | grep -o -E '[^ ]+.dmg$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') + latest_staging_version=$(< /tmp/staging-versions grep "_$MAJOR_VERSION" | sort -r | head -n 1 | grep -o '/.*') rm /tmp/staging-versions echo "[INFO] latest staging version is: $latest_staging_version" diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index bcb125a..bf46ba9 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -60,24 +60,6 @@ configure-vars() { } -############################################ -# is-major-version-greater-than-3 -# GLOBALS: -# MAJOR_VERSION -# set prior to this call via either -# get-generic-major-version or -# get-semantic-major-version -############################################ -is-major-version-greater-than-3() { - - if [[ $MAJOR_VERSION -gt 3 ]]; then - return 0 - else - return 1 - fi - -} - ############################################ # get-generic-major-version # GLOBALS: @@ -109,6 +91,24 @@ get-semantic-major-version(){ } +############################################ +# is-major-version-greater-than-3 +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version +############################################ +is-major-version-greater-than-3() { + + if [[ $MAJOR_VERSION -gt 3 ]]; then + return 0 + else + return 1 + fi + +} + ############################################ # restrict-major-version # GLOBALS: diff --git a/windows/install-senzing.sh b/windows/install-senzing.sh index e390c7d..3792c8c 100755 --- a/windows/install-senzing.sh +++ b/windows/install-senzing.sh @@ -28,6 +28,38 @@ configure-vars() { } +############################################ +# get-generic-major-version +# GLOBALS: +# SENZING_INSTALL_VERSION +# one of: production-v, staging-v +# semver does not apply here +############################################ +get-generic-major-version(){ + + MAJOR_VERSION=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') + echo "[INFO] major version is: $MAJOR_VERSION" + export MAJOR_VERSION + +} + +############################################ +# is-major-version-greater-than-3 +# GLOBALS: +# MAJOR_VERSION +# set prior to this call via +# get-generic-major-version +############################################ +is-major-version-greater-than-3() { + + if [[ $MAJOR_VERSION -gt 3 ]]; then + return 0 + else + return 1 + fi + +} + ############################################ # determine-latest-zip-for-major-version # GLOBALS: @@ -37,11 +69,10 @@ configure-vars() { ############################################ determine-latest-zip-for-major-version() { - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" + get-generic-major-version aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request --region us-east-1 | grep -o -E '[^ ]+.zip$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') + latest_staging_version=$(< /tmp/staging-versions grep "_$MAJOR_VERSION" | sort -r | head -n 1 | grep -o '/.*') rm /tmp/staging-versions echo "[INFO] latest staging version is: $latest_staging_version" @@ -68,8 +99,7 @@ download-zip() { install-senzing() { 7z x -y -o"C:\Program Files" senzingapi.zip - ren "C:\Program Files\senzing" "senzing2" - ren "C:\Program Files\senzing2" "Senzing" + mv "C:\Program Files\senzing" "C:\Program Files\Senzing" } From a44d6cebf94132aeb0517ebe07a46a04bf2530da Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:59:26 -0700 Subject: [PATCH 7/9] cleanup --- CHANGELOG.md | 10 ++++++--- CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++-------------------- action.yaml | 6 +++--- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94646dd..aefbf3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -[markdownlint](https://dlaa.me/markdownlint/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +The format is based on [Keep a Changelog], +[markdownlint], +and this project adheres to [Semantic Versioning]. ## [Unreleased] @@ -72,3 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added to 1.0.0 - Install Senzing API on Linux, macOS, and Windows + +[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ +[markdownlint]: https://dlaa.me/markdownlint/ +[Semantic Versioning]: https://semver.org/spec/v2.0.0.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3fe84d2..17336a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,15 @@ Welcome to the project! -We encourage contribution in a manner consistent with the [Code of Conduct](CODE_OF_CONDUCT.md). +We encourage contribution in a manner consistent with the [Code of Conduct]. The following will guide you through the process. There are a number of ways you can contribute: -1. [Asking questions](#questions) -1. [Requesting features](#feature-requests) -1. [Reporting bugs](#bug-reporting) -1. [Contributing code or documentation](#contributing-code-or-documentation) +1. [Asking questions] +1. [Requesting features] +1. [Reporting bugs] +1. [Contributing code or documentation] ## License Agreements @@ -23,19 +23,19 @@ A license agreement is not needed for submitting feature request, bug reporting, ### Individual Contributor License Agreement In order to contribute to this repository, an -[Individual Contributor License Agreement (ICLA)](.github/senzing-individual-contributor-license-agreement.pdf) +[Individual Contributor License Agreement (ICLA)] must be completed, submitted and accepted. ### Corporate Contributor License Agreement If the contribution to this repository is on behalf of a company, a -[Corporate Contributor License Agreement (CCLA)](.github/senzing-corporate-contributor-license-agreement.pdf) +[Corporate Contributor License Agreement (CCLA)] must also be completed, submitted and accepted. ### Project License Agreement The license agreement for this repository is stated in the -[LICENSE](LICENSE) file. +[LICENSE] file. ## Questions @@ -50,7 +50,7 @@ TODO: Instead, use ??? All feature requests are "GitHub issues". To request a feature, create a -[GitHub issue](https://help.github.com/articles/creating-an-issue/) +[GitHub issue] in this repository. When creating an issue, there will be a choice to create a "Bug report" or a "Feature request". @@ -59,11 +59,8 @@ Choose "Feature request". ## Bug Reporting All bug reports are "GitHub issues". -Before reporting on a bug, check to see if it has -[already been reported](https://github.com/search?q=+is%3Aissue+user%3Asenzing). -To report a bug, create a -[GitHub issue](https://help.github.com/articles/creating-an-issue/) -in this repository. +Before reporting on a bug, check to see if it has [already been reported]. +To report a bug, create a [GitHub issue] in this repository. When creating an issue, there will be a choice to create a "Bug report" or a "Feature request". Choose "Bug report". @@ -71,8 +68,8 @@ Choose "Bug report". ## Contributing code or documentation To contribute code or documentation to the repository, you must have -[License Agreements](#license-agreements) in place. -This needs to be complete before a [Pull Request](#pull-requests) can be accepted. +[License Agreements] in place. +This needs to be complete before a [Pull Request] can be accepted. ### Setting up a development environment @@ -82,8 +79,8 @@ These variables may be modified, but do not need to be modified. The variables are used throughout the installation procedure. ```console -export GIT_ACCOUNT=senzing -export GIT_REPOSITORY=github-action-install-senzing +export GIT_ACCOUNT=senzing-factory +export GIT_REPOSITORY=github-action-install-senzing-api ``` Synthesize environment variables. @@ -116,9 +113,22 @@ TODO: ### Pull Requests Code in the main branch is modified via GitHub pull request. -Follow GitHub's -[Creating a pull request from a branch](https://help.github.com/articles/creating-a-pull-request/) -or -[Creating a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) instructions. +Follow GitHub's [Creating a pull request from a branch] or +[Creating a pull request from a fork] instructions. Accepting pull requests will be at the discretion of Senzing, Inc. and the repository owner(s). + +[already been reported]: https://github.com/search?q=+is%3Aissue+user%3Asenzing +[Asking questions]: #questions +[Code of Conduct]: CODE_OF_CONDUCT.md +[Contributing code or documentation]: #contributing-code-or-documentation +[Corporate Contributor License Agreement (CCLA)]: .github/senzing-corporate-contributor-license-agreement.pdf +[Creating a pull request from a branch]: https://help.github.com/articles/creating-a-pull-request/ +[Creating a pull request from a fork]: https://help.github.com/articles/creating-a-pull-request-from-a-fork/ +[GitHub issue]: https://help.github.com/articles/creating-an-issue/ +[Individual Contributor License Agreement (ICLA)]: .github/senzing-individual-contributor-license-agreement.pdf +[LICENSE]: LICENSE +[License Agreements]: #license-agreements +[Pull Request]: #pull-requests +[Reporting bugs]: #bug-reporting +[Requesting features]: #feature-requests diff --git a/action.yaml b/action.yaml index 4d0c7af..daaa8fb 100644 --- a/action.yaml +++ b/action.yaml @@ -12,19 +12,19 @@ runs: steps: - if: runner.os == 'Linux' name: Run on Linux - uses: senzing-factory/github-action-install-senzing-api/linux@69-skern + uses: senzing-factory/github-action-install-senzing-api/linux@v3 with: senzingapi-runtime-version: ${{ inputs.senzingapi-runtime-version }} - if: runner.os == 'macOS' name: Run on macOS - uses: senzing-factory/github-action-install-senzing-api/darwin@69-skern + uses: senzing-factory/github-action-install-senzing-api/darwin@v3 with: senzingapi-version: ${{ inputs.senzingapi-version }} - if: runner.os == 'Windows' name: Run on Windows - uses: senzing-factory/github-action-install-senzing-api/windows@69-skern + uses: senzing-factory/github-action-install-senzing-api/windows@v3 with: senzingapi-version: ${{ inputs.senzingapi-version }} From 329d2c307b9eef001b558eb897027b3e4a255830 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:02:38 -0700 Subject: [PATCH 8/9] fix linting --- windows/install-senzing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/install-senzing.sh b/windows/install-senzing.sh index 3792c8c..b916e23 100755 --- a/windows/install-senzing.sh +++ b/windows/install-senzing.sh @@ -115,7 +115,7 @@ verify-installation() { echo "[INFO] verify senzing installation" is-major-version-greater-than-3 && BUILD_VERSION_PATH="er/szBuildVersion" || BUILD_VERSION_PATH="g2/g2BuildVersion" - if [ ! -f /c/Program Files/senzing/"$BUILD_VERSION_PATH".json ]; then + if [ ! -f "/c/Program Files/senzing/$BUILD_VERSION_PATH.json" ]; then echo "[ERROR] /c/Program Files/senzing/$BUILD_VERSION_PATH.json not found." exit 1 else From a5fac6475c72c9230e4ee44f3623cf1b15465712 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:08:06 -0700 Subject: [PATCH 9/9] update linting config --- .github/linters/.jscpd.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index 6eb5f17..e0d5a52 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -1,3 +1,5 @@ { - "threshold": 3 + "ignore": [ + "**/install*.sh" + ] } \ No newline at end of file