35 lines
682 B
Bash
35 lines
682 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ "$IMAGE_TAG" == "" ]; then
|
||
|
echo "Make sure IMAGE_TAG is set"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
IMAGE_NAME=gitea.hottis.de/wn/timeserver-monitoring
|
||
|
NAMESPACE=homea
|
||
|
DEPLOYMENT_DIR=$PWD/deployment
|
||
|
CONFIG_FILE=config.json
|
||
|
|
||
|
pushd $DEPLOYMENT_DIR > /dev/null
|
||
|
|
||
|
kubectl create namespace $NAMESPACE \
|
||
|
--dry-run=client \
|
||
|
-o yaml | \
|
||
|
kubectl -f - apply
|
||
|
|
||
|
kubectl create configmap tsm-mqtt-conf \
|
||
|
--from-literal=TSM_MQTT_CONF="`cat $CONFIG_FILE`" \
|
||
|
--dry-run=client \
|
||
|
-o yaml \
|
||
|
--save-config | \
|
||
|
kubectl apply -f - -n $NAMESPACE
|
||
|
|
||
|
|
||
|
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
|
||
|
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
|
||
|
kubectl apply -f - -n $NAMESPACE
|
||
|
|
||
|
popd > /dev/null
|
||
|
|