Created
March 25, 2020 18:20
-
-
Save phantomjinx/e0f0846516ed5007284fcacc3c12ed96 to your computer and use it in GitHub Desktop.
Executable script for applying the fuse-online-template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Execute from the main directory of the fuse-online-install repository | |
# Necessary to find the templates/ directory | |
# | |
ROUTE_HOSTNAME=<FILL IN PREFERRED HOSTNAME HERE> | |
FUSE_NAMESPACE=fuse-ignite | |
IGNITE=fuse-ignite-1.9 | |
LOCAL_REGISTRY=192.168.88.5:32000 | |
TEMPLATE_NAME=fuse-online-template.yml | |
OAUTH_SA_FILE=serviceaccount-as-oauthclient-restricted.yml | |
FUSE_META_IMAGE=fuse-ignite-meta:1.6 | |
FUSE_UI_IMAGE=fuse-ignite-ui:1.6 | |
FUSE_SERVER_IMAGE=fuse-ignite-server:1.6 | |
FUSE_S2I_IMAGE=fuse-ignite-s2i:1.6 | |
FUSE_DB_EXPORTER_IMAGE=fuse-postgres-exporter:1.6 | |
FUSE_DB_IMAGE=fuse-postgres:9.6 | |
FUSE_DV_IMAGE=fuse-dv-rhel:1.6 | |
FUSE_OAUTH_IMAGE=oauth-proxy:4.2 | |
FUSE_PROMETHEUS_IMAGE=prometheus:v3.9 | |
if [ -n "$1" ]; then | |
if [ -f "$1" ]; then | |
IGNITE="$1" | |
else | |
echo "Error: \"$1\" was specified as the template name but a file of that name does not exist" | |
exit 1 | |
fi | |
fi | |
PROJECT=$(oc project -q) | |
if [ -z "${PROJECT}" ]; then | |
echo "No project selected ... exiting" | |
exit 1 | |
fi | |
oc get sa syndesis-oauth-client > /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Cannot find oauth-client template so creating" | |
oc apply -f templates/${OAUTH_SA_FILE} | |
fi | |
TOKEN=$(oc sa get-token syndesis-oauth-client) | |
if [ -z "${TOKEN}" ]; then | |
echo "Failed to create token ... exiting" | |
exit 1 | |
fi | |
oc -n ${FUSE_NAMESPACE} get template ${IGNITE} > /dev/null | |
if [ $? -eq 0 ]; then | |
oc -n ${FUSE_NAMESPACE} delete template ${IGNITE} | |
fi | |
echo "Cannot find ${IGNITE} template so creating" | |
oc -n ${FUSE_NAMESPACE} create -f "templates/${TEMPLATE_NAME}" | |
oc new-app \ | |
--template=${FUSE_NAMESPACE}/${IGNITE} \ | |
-p ROUTE_HOSTNAME=${ROUTE_HOSTNAME} \ | |
-p OPENSHIFT_MASTER=https://localhost:8443 \ | |
-p OPENSHIFT_CONSOLE_URL=https://localhost:8443 \ | |
-p OPENSHIFT_PROJECT=${PROJECT} \ | |
-p OPENSHIFT_OAUTH_CLIENT_SECRET=${TOKEN} \ | |
-p MAX_INTEGRATIONS_PER_USER="1" \ | |
-p SAR_PROJECT=${PROJECT} \ | |
-p SYNDESIS_REGISTRY=${LOCAL_REGISTRY} \ | |
-p IMAGE_STREAM_NAMESPACE=${FUSE_NAMESPACE} \ | |
-p FUSE_META_IMAGE=${FUSE_META_IMAGE} \ | |
-p FUSE_UI_IMAGE=${FUSE_UI_IMAGE} \ | |
-p FUSE_SERVER_IMAGE=${FUSE_SERVER_IMAGE} \ | |
-p FUSE_S2I_IMAGE=${FUSE_S2I_IMAGE} \ | |
-p FUSE_DB_EXPORTER_IMAGE=${FUSE_DB_EXPORTER_IMAGE} \ | |
-p FUSE_DB_IMAGE=${FUSE_DB_IMAGE} \ | |
-p FUSE_DV_IMAGE=${FUSE_DV_IMAGE} \ | |
-p FUSE_OAUTH_IMAGE=${FUSE_OAUTH_IMAGE} \ | |
-p FUSE_PROMETHEUS_IMAGE=${FUSE_PROMETHEUS_IMAGE} \ | |
-n ${PROJECT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment