This commit is contained in:
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
|
||||
if [ "$GPG_PASSPHRASE" == "" ]; then
|
||||
echo "Make sure GPG_PASSPHRASE is set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IMAGE_NAME=gitea.hottis.de/wn/mini_flask
|
||||
NAMESPACE=homepages
|
||||
DEPLOYMENT_DIR=$PWD/deployment
|
||||
|
||||
pushd $DEPLOYMENT_DIR > /dev/null
|
||||
kubectl create namespace $NAMESPACE \
|
||||
--dry-run=client \
|
||||
-o yaml | \
|
||||
kubectl -f - apply
|
||||
|
||||
SECRETS_FILE=`mktemp`
|
||||
gpg --decrypt --passphrase $GPG_PASSPHRASE --yes --batch --homedir /tmp/.gnupg --output $SECRETS_FILE secrets.asc
|
||||
|
||||
kubectl create secret generic mini_flask \
|
||||
--dry-run=client \
|
||||
-o yaml \
|
||||
--save-config \
|
||||
--from-env-file=<(sed 's/^export //g' $SECRETS_FILE) | \
|
||||
kubectl apply -f - -n $NAMESPACE
|
||||
rm $SECRETS_FILE
|
||||
|
||||
# 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