Skip to content

Commit

Permalink
Add yq script (#36)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tonyxrmdavidson authored Mar 28, 2024
1 parent 164d7dc commit 65cd8d8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions openshift-ci/scripts/install_yq.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions openshift-ci/scripts/oci-model-registry-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 65cd8d8

Please sign in to comment.