deployment
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed

This commit is contained in:
2024-12-02 09:42:12 +01:00
parent defee32084
commit 04b0218280
9 changed files with 114 additions and 3 deletions

View File

@ -6,8 +6,10 @@
"includeTopics": [
"#"
],
"includeTopics": [
"mainscnt/#"
"excludeTopics": [
"IoT/Watchdog",
"snmp",
"MainsCnt/#",
"cem/#"
]
}

View File

@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ma
labels:
app: ma
annotations:
secret.reloader.stakater.com/reload: ma-db-cred
spec:
replicas: 1
selector:
matchLabels:
app: ma
template:
metadata:
labels:
app: ma
spec:
containers:
- name: ma
image: %IMAGE%
imagePullPolicy: Always
envFrom:
- secretRef:
name: ma-db-cred
- configMapRef:
name: ma-conf

29
deployment/deploy.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
ARG1=$1
NAMESPACE=`cat namespace`
IMAGE_NAME=$FORGE_NAME/$CI_REPO
DEPLOYMENT_DIR=$PWD/deployment
pushd $DEPLOYMENT_DIR > /dev/null
./roll-db-credential.sh
kubectl create configmap ma-conf \
--from-literal=MA_CONF="`cat config.json`" \
--dry-run=client \
--o yaml \
--save-config | \
kubectl apply -f - -n $NAMESPACE
cat deploy-yml.tmpl | \
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
kubectl apply -f - -n $NAMESPACE
popd /dev/null

1
deployment/namespace Normal file
View File

@ -0,0 +1 @@
homea

View File

@ -9,7 +9,7 @@ export PGSSLMODE=require
DATABASE=ma
LOGIN=ma
PASSWORD=`openssl rand -base64 24`
NAMESPACE=homea
NAMESPACE=`cat namespace`
psql <<EOF
do