diff --git a/scripts/deploy-remote.sh b/scripts/deploy-remote.sh index 8e13686..24635de 100644 --- a/scripts/deploy-remote.sh +++ b/scripts/deploy-remote.sh @@ -52,10 +52,19 @@ if [ -r "$SECRETS_FILE" ]; then fi POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-$(openssl rand -hex 24)}" JWT_SECRET="${JWT_SECRET:-$(openssl rand -hex 32)}" -cat > "$SECRETS_FILE" < "${file}.tmp" || true + mv "${file}.tmp" "$file" + fi + echo "${key}=${val}" >> "$file" +} +touch "$SECRETS_FILE" +write_kv POSTGRES_PASSWORD "$POSTGRES_PASSWORD" "$SECRETS_FILE" +write_kv JWT_SECRET "$JWT_SECRET" "$SECRETS_FILE" chmod 600 "$SECRETS_FILE" kubectl -n insurance create secret generic postgres-credentials \