Files
backend/bin/secret-push
2024-07-26 20:09:19 -04:00

28 lines
492 B
Bash
Executable File

#!/bin/bash
if [ "$1" == "" ]; then
echo 'usage: secret-push {config_name} [secret_name]'
exit 1
fi
CONFIG=$1
shift
if [ "$1" != "" ]; then
KEY=backend-$1
else
KEY=backend
fi
FILE="conf/dexorder-$CONFIG.toml"
if [ ! -f "$FILE" ]; then
FILE="conf/$CONFIG/dexorder-$CONFIG.toml"
fi
if [ ! -f "$FILE" ]; then
echo Could not find config file for $1
exit 1;
fi
kubectl create secret generic "$KEY" --from-file ".secret.toml=$FILE" --dry-run=client -o yaml | kubectl apply -f -