All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
39 lines
849 B
Bash
Executable File
39 lines
849 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$IMAGE_TAG" == "" ]; then
|
|
echo "Make sure IMAGE_TAG is set"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
IMAGE_NAME=gitea.hottis.de/deployments/bind
|
|
NAMESPACE=bind
|
|
DEPLOYMENT_DIR=$PWD/deployment
|
|
|
|
pushd $DEPLOYMENT_DIR > /dev/null
|
|
|
|
if [ ! -f transfer-key.conf ]; then
|
|
gpg --decrypt --passphrase $GPG_PASSPHRASE --yes --batch --homedir /tmp/.gnupg --output transfer-key.conf transfer-key.conf.asc
|
|
fi
|
|
|
|
kubectl create namespace $NAMESPACE \
|
|
--dry-run=client \
|
|
-o yaml | \
|
|
kubectl -f - apply
|
|
|
|
# Create secret for transfer-key
|
|
kubectl create secret generic transfer-key \
|
|
--from-file=transfer-key.conf=transfer-key.conf \
|
|
--namespace=$NAMESPACE \
|
|
--dry-run=client \
|
|
-o yaml | \
|
|
kubectl apply -f -
|
|
|
|
|
|
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
|
|
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
|
|
kubectl apply -f - -n $NAMESPACE
|
|
|
|
popd > /dev/null
|
|
|