Skip to content

Instantly share code, notes, and snippets.

@ipolyzos
Last active March 16, 2020 13:17
Show Gist options
  • Save ipolyzos/87995319a3a847c9f2e39303ba6f7d75 to your computer and use it in GitHub Desktop.
Save ipolyzos/87995319a3a847c9f2e39303ba6f7d75 to your computer and use it in GitHub Desktop.
Weblogic Operator Deploy (wod) aim to help on deploying the weblogic operator in a aubernetes cluster.
#!/bin/bash
# MIT License
#
# Copyright (c) 2020 Ioannis Polyzos
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Weblogic Operator Deploy
#
# Description:
# A simple bash helper script for deployment and/or update of the weblogic operator.
#
# NOTE:
# The script requires Helm 3.x
#
# Author: Ioannis Polyzos
unset WO_NAME,WO_CHART,WO_NS,WO_IMAGE,WO_SA,WO_NAMESPACES
# parse arguments
while (( "$#" )); do
case "$1" in
-h|--help)
echo "wod.sh : Weblogic Operator Deploy (wod) aim to help on deploying the weblogic operator in a kubernetes cluster."
echo "Usage: ./wod.sh -n [DEPLOYMENT_NAME] -c [HELM_CHART] -n [NAMESPACE] -i [IMAGE] -a [SERVICE_ACCOUNT] -s [NAMESPACES]"
echo "options: "
echo " -n, --name Deployment name."
echo " -c, --chart Chart to be used for deployment."
echo " -n, --namespace Deployment namespace."
echo " -i, --image Image to be used for the operator."
echo " -a, --service-account Servicce account to be used for the operator."
echo " -s, --namespaces The namespace to be watched from the operator."
echo " -h, --help Display this help message."
exit 0
;;
-n | --name)
WO_NAME=$2
shift 2
;;
-c | --chart)
WO_CHART=$2
shift 2
;;
-n | --namespace)
WO_NS=$2
shift 2
;;
-i | --image)
WO_IMAGE=$2
shift 2
;;
-a | --service-account)
WO_SA=$2
shift 2
;;
-s | --namespaces)
WO_NAMESPACES=$2
shift 2
;;
*)
echo "Invalid Option: $1" 1>&2
echo "use --help or -h for more."
exit -1
;;
esac
done
helm upgrade --install \
${WO_NAME} ${WO_CHART}\
--namespace ${WO_NS} \
--set image=${WO_IMAGE} \
--set serviceAccount=${WO_SA} \
--set "domainNamespaces={${WO_NAMESPACES}" \
--wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment