Skip to content

Commit

Permalink
#59 switch from senzingapi to senzingapi-runtime (#60)
Browse files Browse the repository at this point in the history
* #59 switch to runtime

* switch to branch

* bump version
  • Loading branch information
kernelsam authored Apr 12, 2024
1 parent 17656ad commit b1e17ad
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 43 deletions.
14 changes: 7 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Install Senzing API
description: Install Senzing API based on platform.
name: Install Senzing API Runtime
description: Install Senzing API Runtime based on platform.
author: support@senzing.com

inputs:
senzingapi-version:
senzingapi-runtime-version:
description: Version of Senzing API to install
required: true

Expand All @@ -12,19 +12,19 @@ runs:
steps:
- if: runner.os == 'Linux'
name: Run on Linux
uses: senzing-factory/github-action-install-senzing-api/linux@v2
uses: senzing-factory/github-action-install-senzing-api/linux@v3
with:
senzingapi-version: ${{ inputs.senzingapi-version }}
senzingapi-runtime-version: ${{ inputs.senzingapi-runtime-version }}

- if: runner.os == 'macOS'
name: Run on macOS
uses: senzing-factory/github-action-install-senzing-api/darwin@v2
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@v2
uses: senzing-factory/github-action-install-senzing-api/windows@v3
with:
senzingapi-version: ${{ inputs.senzingapi-version }}

Expand Down
26 changes: 6 additions & 20 deletions linux/action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Install Senzing - linux
description: Install Senzing API on the linux platform.
name: Install Senzing API Runtime - linux
description: Install Senzing API Runtime on the linux platform.
author: support@senzing.com

inputs:
senzingapi-version:
description: Version of Senzing API to install
description: Version of Senzing API Runtime to install
required: false
default: latest

Expand All @@ -16,28 +16,14 @@ runs:

- env:
SENZING_ACCEPT_EULA: I_ACCEPT_THE_SENZING_EULA
SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }}
name: Install Senzing API
SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-runtime-version }}
name: Install Senzing API Runtime
shell: bash
run: ${{ github.action_path }}/install-senzing.sh

# Adjust files for "system install".

- name: Configure Senzing API
shell: bash
run: |
sudo mv /opt/senzing/data/4.0.0/* /opt/senzing/data/
sudo mkdir /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/cfgVariant.json /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/customGn.txt /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/customOn.txt /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/customSn.txt /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/defaultGNRCP.config /etc/opt/senzing
sudo cp /opt/senzing/g2/resources/templates/stb.config /etc/opt/senzing
# Verify installation.

- name: Verify installed Senzing API version
- name: Verify installed Senzing API Runtime version
shell: bash
run: cat /opt/senzing/g2/g2BuildVersion.json

Expand Down
32 changes: 16 additions & 16 deletions linux/install-senzing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ configure-vars() {

if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then

echo "[INFO] install senzingapi from production"
echo "[INFO] install senzingapi-runtime from production"
INSTALL_REPO="$PROD_REPO"
SENZING_PACKAGE="senzingapi"
SENZING_PACKAGE="senzingapi-runtime"
restrict-major-version

elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then

echo "[INFO] install senzingapi from staging"
echo "[INFO] install senzingapi-runtime from staging"
INSTALL_REPO="$STAGING_REPO"
SENZING_PACKAGE="senzingapi"
SENZING_PACKAGE="senzingapi-runtime"
restrict-major-version

elif [[ $SENZING_INSTALL_VERSION =~ $REGEX_SEM_VER ]]; then

echo "[INFO] install senzingapi semantic version"
echo "[INFO] install senzingapi-runtime semantic version"
INSTALL_REPO="$PROD_REPO"
SENZING_PACKAGE="senzingapi=$SENZING_INSTALL_VERSION*"
SENZING_PACKAGE="senzingapi-runtime=$SENZING_INSTALL_VERSION*"

elif [[ $SENZING_INSTALL_VERSION =~ $REGEX_SEM_VER_BUILD_NUM ]]; then

echo "[INFO] install senzingapi semantic version with build number"
echo "[INFO] install senzingapi-runtime semantic version with build number"
INSTALL_REPO="$PROD_REPO"
SENZING_PACKAGE="senzingapi=$SENZING_INSTALL_VERSION"
SENZING_PACKAGE="senzingapi-runtime=$SENZING_INSTALL_VERSION"

else
echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported"
echo "[ERROR] senzingapi-runtime install version $SENZING_INSTALL_VERSION is unsupported"
exit 1
fi

Expand All @@ -62,12 +62,12 @@ configure-vars() {
restrict-major-version() {

MAJOR_VERSION=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$')
senzingapi_preferences_file="/etc/apt/preferences.d/senzingapi"
echo "[INFO] restrict senzingapi major version to: $MAJOR_VERSION"
senzingapi_runtime_preferences_file="/etc/apt/preferences.d/senzingapi-runtime"
echo "[INFO] restrict senzingapi-runtime major version to: $MAJOR_VERSION"

echo "Package: senzingapi" | sudo tee -a $senzingapi_preferences_file
echo "Pin: version $MAJOR_VERSION.*" | sudo tee -a $senzingapi_preferences_file
echo "Pin-Priority: 999" | sudo tee -a $senzingapi_preferences_file
echo "Package: senzingapi-runtime" | sudo tee -a $senzingapi_runtime_preferences_file
echo "Pin: version $MAJOR_VERSION.*" | sudo tee -a $senzingapi_runtime_preferences_file
echo "Pin-Priority: 999" | sudo tee -a $senzingapi_runtime_preferences_file

}

Expand All @@ -94,7 +94,7 @@ install-senzing-repository() {
# SENZING_PACKAGE
# full package name used for install
############################################
install-senzingapi() {
install-senzingapi-runtime() {

echo "[INFO] sudo --preserve-env apt-get -y install $SENZING_PACKAGE"
sudo --preserve-env apt-get -y install "$SENZING_PACKAGE"
Expand All @@ -108,4 +108,4 @@ install-senzingapi() {
echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION"
configure-vars
install-senzing-repository
install-senzingapi
install-senzingapi-runtime

0 comments on commit b1e17ad

Please sign in to comment.