-
Notifications
You must be signed in to change notification settings - Fork 13
/
deploy-plugin.sh
executable file
·52 lines (46 loc) · 1.41 KB
/
deploy-plugin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env sh
TLS_ENABLED="true"
DEFAULT_IMAGE="quay.io/artemiscloud/activemq-artemis-self-provisioning-plugin:latest"
PLUGIN_IMAGE=${DEFAULT_IMAGE}
SCRIPT_NAME=$(basename "$0")
function printUsage() {
echo "${SCRIPT_NAME}: Deploying plugin to openshift"
echo "Usage:"
echo " ./${SCRIPT_NAME} -i|--image <image url> -n|--nossl"
echo "Options: "
echo " -i|--image Specify the plugin image to deploy. (default is ${DEFAULT_IMAGE})"
echo " -n|--nossl Use plain http protocol (default is https)"
echo " -h|--help Print this message."
}
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
printUsage
exit 0
;;
-i|--image)
PLUGIN_IMAGE="$2"
shift
shift
;;
-n|--nossl)
TLS_ENABLED="false"
shift # past argument
;;
-*|--*)
echo "Unknown option $1"
printUsage
exit 1
;;
*)
;;
esac
done
if [ ${TLS_ENABLED} == "true" ]; then
echo "deploying plugin in https mode using image: ${PLUGIN_IMAGE}"
oc kustomize deploy/base | sed "s|image: .*|image: ${PLUGIN_IMAGE}|" | oc apply -f -
else
echo "deploying plugin in http mode using image: ${PLUGIN_IMAGE}"
oc kustomize deploy/http | sed "s|image: .*|image: ${PLUGIN_IMAGE}|" | oc apply -f -
fi
oc patch consoles.operator.openshift.io cluster --type=json --patch '[{ "op": "add", "path": "/spec/plugins/-", "value": "activemq-artemis-self-provisioning-plugin" }]'