From 65cd8d8d6b851629533c4c828fce5c94ad513219 Mon Sep 17 00:00:00 2001 From: Tony Davidson Date: Thu, 28 Mar 2024 14:18:48 +0000 Subject: [PATCH] Add yq script (#36) * Added DSCI config * This commit corrects the order in which the DSCI is applied uses the correct default dsci needed for correct application * This commit adds a script to test if yq is installed and installs it if it isn't * This commit removes the script call as it is not needed --- openshift-ci/scripts/install_yq.sh | 32 +++++++++++++++++++ .../scripts/oci-model-registry-deploy.sh | 1 + 2 files changed, 33 insertions(+) create mode 100755 openshift-ci/scripts/install_yq.sh diff --git a/openshift-ci/scripts/install_yq.sh b/openshift-ci/scripts/install_yq.sh new file mode 100755 index 00000000..0d894fb8 --- /dev/null +++ b/openshift-ci/scripts/install_yq.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +install_yq_if_not_installed() { + # Check operating system + os=$(uname -s) + case $os in + Linux*) + if ! command -v yq &>/dev/null; then + echo "yq is not installed. Installing..." + # Linux installation using curl + sudo curl -L https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -o /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq + else + echo "yq is already installed." + fi + ;; + Darwin*) + if ! command -v yq &>/dev/null; then + echo "yq is not installed. Installing..." + # macOS installation using Homebrew + brew install yq + else + echo "yq is already installed." + fi + ;; + *) + echo "Unsupported operating system: $os" + ;; + esac +} + +# Call the function when the script is sourced +install_yq_if_not_installed \ No newline at end of file diff --git a/openshift-ci/scripts/oci-model-registry-deploy.sh b/openshift-ci/scripts/oci-model-registry-deploy.sh index befe982b..5ec44526 100755 --- a/openshift-ci/scripts/oci-model-registry-deploy.sh +++ b/openshift-ci/scripts/oci-model-registry-deploy.sh @@ -6,6 +6,7 @@ DSC_INITIALIZATION_MANIFEST="openshift-ci/resources/model-registry-DSCInitializa DATA_SCIENCE_CLUSTER_MANIFEST="openshift-ci/resources/opendatahub-data-science-cluster.yaml" MODEL_REGISTRY_OPERATOR_GIT_URL="https://github.com/opendatahub-io/model-registry-operator.git" source "openshift-ci/scripts/colour_text_variables.sh" +source "openshift-ci/scripts/install_yq.sh" # Function to deploy and wait for deployment deploy_and_wait() {