-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·44 lines (37 loc) · 1.31 KB
/
deploy.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
#!/bin/bash
export KUBE_NAMESPACE=${KUBE_NAMESPACE}
export KUBE_SERVER=${KUBE_SERVER}
if [[ -z ${VERSION} ]] ; then
export VERSION=${IMAGE_VERSION}
fi
if [[ ${ENVIRONMENT} == "prod" ]] ; then
echo "deploy ${VERSION} to prod namespace, using HOCS_INFO_SERVICE_PROD drone secret"
export KUBE_TOKEN=${HOCS_INFO_SERVICE_PROD}
export REPLICAS="2"
else
if [[ ${ENVIRONMENT} == "qa" ]] ; then
echo "deploy ${VERSION} to test namespace, using HOCS_INFO_SERVICE_QA drone secret"
export KUBE_TOKEN=${HOCS_INFO_SERVICE_QA}
export REPLICAS="2"
elif [[ ${ENVIRONMENT} == "demo" ]] ; then
echo "deploy ${VERSION} to demo namespace, using HOCS_INFO_SERVICE_DEMO drone secret"
export KUBE_TOKEN=${HOCS_INFO_SERVICE_DEMO}
export REPLICAS="1"
elif [[ ${ENVIRONMENT} == "dev" ]] ; then
echo "deploy ${VERSION} to dev namespace, using HOCS_INFO_SERVICE_DEV drone secret"
export KUBE_TOKEN=${HOCS_INFO_SERVICE_DEV}
export REPLICAS="1"
else
echo "Unable to find environment: ${ENVIRONMENT}"
fi
fi
if [[ -z ${KUBE_TOKEN} ]] ; then
echo "Failed to find a value for KUBE_TOKEN - exiting"
exit -1
fi
cd kd
kd --insecure-skip-tls-verify \
--timeout 10m \
-f deployment.yaml \
-f service.yaml \
-f refreshmembers.yaml