still database stuff
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -19,10 +19,14 @@ steps:
|
|||||||
secrets:
|
secrets:
|
||||||
- source: kube_config
|
- source: kube_config
|
||||||
target: KUBE_CONFIG_CONTENT
|
target: KUBE_CONFIG_CONTENT
|
||||||
|
- source: encryption_key
|
||||||
|
target: ENCRYPTION_KEY
|
||||||
|
- source: secrets_checksum
|
||||||
|
target: MD5_CHECKSUM
|
||||||
commands:
|
commands:
|
||||||
- export IMAGE_TAG=$CI_COMMIT_TAG
|
- export IMAGE_TAG=$CI_COMMIT_TAG
|
||||||
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||||
- export KUBECONFIG=/tmp/kubeconfig
|
- export KUBECONFIG=/tmp/kubeconfig
|
||||||
- cat ./deployment/install-yml.tmpl | sed -e 's,%IMAGETAG%,'$IMAGE_TAG','g | kubectl apply -f -
|
- ./deployment/deploy.sh
|
||||||
when:
|
when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: homea
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -23,6 +18,9 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: locsrv
|
- name: locsrv
|
||||||
image: gitea.hottis.de/wn/locsrv:%IMAGETAG%
|
image: gitea.hottis.de/wn/locsrv:%IMAGETAG%
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: locsrv-db-cred
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
39
deployment/deploy.sh
Executable file
39
deployment/deploy.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$IMAGE_TAG" == "" ]; then
|
||||||
|
echo "Make sure IMAGE_TAG is set"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
IMAGE_NAME=gitea.hottis.de/wn/locsrv
|
||||||
|
NAMESPACE=homea
|
||||||
|
DEPLOYMENT_DIR=$PWD/deployment
|
||||||
|
|
||||||
|
pushd $DEPLOYMENT_DIR > /dev/null
|
||||||
|
./decrypt-secrets.sh || exit 1
|
||||||
|
. /tmp/secrets
|
||||||
|
rm /tmp/secrets
|
||||||
|
|
||||||
|
kubectl create namespace $NAMESPACE \
|
||||||
|
--dry-run=client \
|
||||||
|
-o yaml | \
|
||||||
|
kubectl -f - apply
|
||||||
|
|
||||||
|
kubectl create secret generic locsrv-db-cred \
|
||||||
|
--dry-run=client \
|
||||||
|
-o yaml \
|
||||||
|
--save-config \
|
||||||
|
--from-literal=PGUSER="$PGUSER" \
|
||||||
|
--from-literal=PGPASSWORD="$PGPASSWORD" \
|
||||||
|
--from-literal=PGDATABASE="$PGDATABASE" \
|
||||||
|
--from-literal=PGHOST="timescaledb.database.svc.cluster.local" \
|
||||||
|
--from-literal=PGSSLMODE="require" | \
|
||||||
|
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
|
||||||
|
|
Reference in New Issue
Block a user