bin/secret-push

This commit is contained in:
tim
2024-10-06 16:00:18 -04:00
parent 6525b40663
commit 2856ce1001
4 changed files with 30 additions and 20 deletions

View File

@@ -1,11 +0,0 @@
DEXORDER_PORT=3001
DEXORDER_CORS=*
DEXORDER_DB_URL=postgresql://dexorder:redroxed@postgres:5432/dexorder
DEXORDER_REDIS_URL=redis://redis:6379
# Dexorder Alpha chain
DEXORDER_DEPLOYMENT_1337=alpha
DEXORDER_RPC_URL_1337=http://alpharpc:8545
# dev account #2
DEXORDER_ACCOUNTS_1337=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a

View File

@@ -1,9 +0,0 @@
DEXORDER_PORT=3001
DEXORDER_CORS=*
DEXORDER_DB_URL=postgresql://dexorder:redroxed@postgres:5432/dexorder
DEXORDER_REDIS_URL=redis://redis:6379
DEXORDER_DEPLOYMENT_421614=arbsep
DEXORDER_RPC_URL_421614=https://arb-sepolia.g.alchemy.com/v2/lEA3hXyI1G-8Jiv3OvNqpkDN0ATe38zn
DEXORDER_ACCOUNTS_421614=065b7ef20b68ff99e71774acae7759a873073ac3d3c502ceb90f01efb3c48079

2
.gitignore vendored
View File

@@ -2,6 +2,8 @@
/.vscode /.vscode
/.env /.env
/.env-*
!/.env-mock
# File-based project format # File-based project format
*.iws *.iws

28
bin/secret-push Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
SCRIPT_DIR="$(dirname -- "$( readlink -f -- "$0"; )";)"
CONF_DIR="$SCRIPT_DIR/.."
if [ "$1" == "" ]; then
echo 'usage: secret-push {config_name} [secret_name]'
exit 1
fi
CONFIG=$1
shift
if [ "$1" != "" ]; then
KEY=server-secret-$1
else
KEY=server-secret
fi
FILE="$CONF_DIR/.env-$CONFIG"
if [ ! -f "$FILE" ]; then
echo Could not find env file for $FILE
exit 1;
fi
kubectl create secret generic "$KEY" --from-file ".env=$FILE" --dry-run=client -o yaml | kubectl apply -f -