-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-helm.sh
executable file
·56 lines (43 loc) · 1.11 KB
/
deploy-helm.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
53
54
55
56
#!/bin/bash
context=$1
namespace=$2
imageTag=$3
database=$4
serviceType=$5
nodePort=$6
echo "context: ${context}"
echo "namespace: ${namespace}"
echo "imageTag: ${imageTag}"
echo "database: ${database}"
echo "serviceType: ${serviceType}"
echo "nodePort: ${nodePort}"
kubeContextArg=""
if [[ ${context} != "" ]]
then
kubeContextArg="--kube-context ${context}"
fi
namespaceArg=""
if [[ ${namespace} != "" ]]
then
namespaceArg="--namespace ${namespace}"
fi
serviceTypeArg=""
if [[ ${serviceType} != "" ]]
then
serviceTypeArg="--set service.type=${serviceType}"
fi
nodePortArg=""
if [[ ${nodePort} != "" ]]
then
nodePortArg="--set service.nodePort=${nodePort}"
fi
helm ${kubeContextArg} ${namespaceArg} install -n lightning-kube --set database=${database} ${serviceTypeArg} ${nodePortArg} --set image.tag=${imageTag} charts/lightning-kube
if [ $? -eq 0 ]
then
echo "Deploy Success"
else
echo "Deploy Error" >&2
fi
#./deploy-helm.sh minikube jx-local 0.0.1 cryptocurrency-services-local
#./deploy-helm.sh "" jx-local 0.0.1 cryptocurrency-services-local
#./deploy-helm.sh "" "" 0.0.1 cryptocurrency-services-local