diff --git a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh index c56554aafc..86d4c9291d 100755 --- a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh @@ -336,7 +336,7 @@ do OPENSHIFT_TEMPLATE=$OPENSHIFT_SERVICES_TEMPLATE TEMPLATE_PARAMETERS+=(-p SERVICEBROKER_NAME="${MAP_SERVICE_NAME_TO_SERVICEBROKERS_NAME["${SERVICE_NAME}"]}") TEMPLATE_PARAMETERS+=(-p SERVICEBROKER_PLAN_NAME="${MAP_SERVICE_NAME_TO_SERVICEBROKERS_PLAN_NAME["${SERVICE_NAME}"]}") - . /oc-build-deploy/scripts/exec-openshift-resources.sh + . /oc-build-deploy/scripts/exec-openshift-create-servicebroker.sh SERVICEBROKERS+=("${SERVICE_NAME}:${SERVICE_TYPE}") fi diff --git a/images/oc-build-deploy-dind/scripts/exec-openshift-create-servicebroker.sh b/images/oc-build-deploy-dind/scripts/exec-openshift-create-servicebroker.sh new file mode 100755 index 0000000000..564eef16a8 --- /dev/null +++ b/images/oc-build-deploy-dind/scripts/exec-openshift-create-servicebroker.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} get servicebroker "${SERVICE_NAME}" &> /dev/null; then + echo "ServiceBroker ${SERVICE_NAME} already existing, not attempting to update" +else + oc process --local -o yaml --insecure-skip-tls-verify \ + -n ${OPENSHIFT_PROJECT} \ + -f ${OPENSHIFT_TEMPLATE} \ + -p SERVICE_NAME="${SERVICE_NAME}" \ + -p SAFE_BRANCH="${SAFE_BRANCH}" \ + -p SAFE_PROJECT="${SAFE_PROJECT}" \ + -p BRANCH="${BRANCH}" \ + -p PROJECT="${PROJECT}" \ + -p LAGOON_GIT_SHA="${LAGOON_GIT_SHA}" \ + -p SERVICE_ROUTER_URL="${SERVICE_ROUTER_URL}" \ + -p REGISTRY="${OPENSHIFT_REGISTRY}" \ + -p OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT} \ + "${TEMPLATE_PARAMETERS[@]}" \ + | outputToYaml +fi \ No newline at end of file