Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This commit will install kustomize in the openshift-ci environment #66

Closed
78 changes: 78 additions & 0 deletions openshift-ci/scripts/install_kustomize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

set -e
version="v3.2.3"

# Function to detect the operating system
detect_os() {
case "$(uname -s)" in
Linux*) os="linux";;
Darwin*) os="darwin";;
CYGWIN*|MINGW*|MSYS_NT*) os="windows";;
*) echo "Unsupported OS: $(uname -s)"; exit 1;;
esac
echo "${os}"
}

# Function to detect the architecture
detect_arch() {
case "$(uname -m)" in
x86_64) arch="amd64";;
armv7l) arch="arm";;
aarch64) arch="arm64";;
*) echo "Unsupported architecture: $(uname -m)"; exit 1;;
esac
echo "${arch}"
}

# Function to check if Kustomize is installed
check_kustomize_installed() {
# Check if kustomize command exists and can run 'kustomize version'
if version_output=$(kustomize version 2>/dev/null); then
echo "Success: Kustomize is installed. Version: ${version_output}"
else
echo "Fail: Kustomize is not installed."
return 1
fi
}

# Function to download and install Kustomize
install_kustomize() {
os=$1
arch=$2

local url="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$version/kustomize_kustomize.v3.2.3_$os_$arch"

echo "Downloading Kustomize from ${url}..."
curl -LO "${url}"

echo "Extracting Kustomize..."

output=$(ls | grep kustomize)
echo "${output}"

mv "${output}" kustomize

echo "Installing Kustomize..."
chmod +x kustomize
export PATH=`pwd`:$PATH

echo "Kustomize installed successfully!"
}

# Main script execution
main() {
echo "Detecting OS and architecture..."
os=$(detect_os)
arch=$(detect_arch)

echo "OS: ${os}"
echo "Architecture: ${arch}"

install_kustomize "${os}" "${arch}"

check_kustomize_installed
}

# Run the main function
main
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 @@ -10,6 +10,7 @@ OPENDATAHUB_CRDS="datascienceclusters.datasciencecluster.opendatahub.io,dsciniti
DATA_SCIENCE_CLUSTER_CRDS="acceleratorprofiles.dashboard.opendatahub.io,datasciencepipelinesapplications.datasciencepipelinesapplications.opendatahub.io,odhapplications.dashboard.opendatahub.io,odhdashboardconfigs.opendatahub.io,odhdocuments.dashboard.opendatahub.io"
MODEL_REGISTRY_CRDS="modelregistries.modelregistry.opendatahub.io"
source "openshift-ci/scripts/colour_text_variables.sh"
source "openshift-ci/scripts/install_kustomize.sh"

# Function to monitor CRDS creation and deployment.
# The function takes two arguments, reference to manifest and a wait time in seconds.
Expand Down
Loading