Skip to content

Commit

Permalink
OSD GCP setup
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashkhileri committed Oct 28, 2024
1 parent 0efb7d0 commit ee04130
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 32 deletions.
22 changes: 5 additions & 17 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,24 +247,14 @@ check_backstage_running() {
return 1
}

install_pipelines_operator() {
local dir=$1
DISPLAY_NAME="Red Hat OpenShift Pipelines"

if oc get csv -n "openshift-operators" | grep -q "${DISPLAY_NAME}"; then
echo "Red Hat OpenShift Pipelines operator is already installed."
else
echo "Red Hat OpenShift Pipelines operator is not installed. Installing..."
oc apply -f "${dir}/resources/pipeline-run/pipelines-operator.yaml"
fi
wait_for_deployment "openshift-operators" "pipelines"
}

initiate_deployments() {
add_helm_repos
configure_namespace "${NAME_SPACE}"

install_pipelines_operator "${DIR}"
install_crunchy_postgres_operator
install_helm
add_helm_repos

configure_namespace "${NAME_SPACE}"
uninstall_helmchart "${NAME_SPACE}" "${RELEASE_NAME}"

# Deploy redis cache db.
Expand All @@ -279,8 +269,6 @@ initiate_deployments() {
configure_namespace "${NAME_SPACE_RBAC}"
configure_external_postgres_db "${NAME_SPACE_RBAC}"


install_pipelines_operator "${DIR}"
uninstall_helmchart "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE : ${RELEASE_NAME_RBAC}"
Expand Down
50 changes: 35 additions & 15 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,38 @@ wait_for_deployment() {
return 1
}

# install_pipelines_operator() {
# oc apply -f - <<EOF
# apiVersion: operators.coreos.com/v1alpha1
# kind: Subscription
# metadata:
# name: openshift-pipelines-operator
# namespace: openshift-operators
# spec:
# channel: "pipelines-1.12"
# name: openshift-pipelines-operator-rh
# source: redhat-operators
# sourceNamespace: openshift-marketplace
# EOF
# wait_for_deployment "openshift-operators" "pipelines"
# }
install_subscription(){
name=$1
namespace=$2
package=$3
channel=$4
source_name=$5
oc apply -f - << EOD
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: $name
namespace: $namespace
spec:
channel: $channel
installPlanApproval: Automatic
name: $package
source: $source_name
sourceNamespace: openshift-marketplace
EOD
}

install_crunchy_postgres_operator(){
install_subscription crunchy-postgres-operator openshift-operators crunchy-postgres-operator v5 certified-operators
}

install_pipelines_operator() {
DISPLAY_NAME="Red Hat OpenShift Pipelines"
if oc get csv -n "openshift-operators" | grep -q "${DISPLAY_NAME}"; then
echo "Red Hat OpenShift Pipelines operator is already installed."
else
echo "Red Hat OpenShift Pipelines operator is not installed. Installing..."
install_subscription openshift-pipelines-operator openshift-operators openshift-pipelines-operator-rh latest redhat-operators
wait_for_deployment "openshift-operators" "pipelines"
fi
}

0 comments on commit ee04130

Please sign in to comment.