unoverse 0.1.63 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/operator/lib/deploy.sh +28 -0
- package/package.json +1 -1
package/operator/lib/deploy.sh
CHANGED
|
@@ -152,6 +152,34 @@ cmd_deploy() {
|
|
|
152
152
|
fi
|
|
153
153
|
}
|
|
154
154
|
echo ""
|
|
155
|
+
# POSTGRES: ASK, DO NOT ASSUME. The ground discovers an existing cluster and writes
|
|
156
|
+
# it as a COMMENTED line, so the default silently provisions a SECOND database next
|
|
157
|
+
# to one the account already pays for. A choice with a monthly bill attached is a
|
|
158
|
+
# question, not a line to notice in a file.
|
|
159
|
+
if [ "$cloud" = "digitalocean" ] \
|
|
160
|
+
&& grep -q '^#[[:space:]]*existing_pg_cluster_name' "$tfv" 2>/dev/null \
|
|
161
|
+
&& ! grep -q '^existing_pg_cluster_name' "$tfv" 2>/dev/null \
|
|
162
|
+
&& ! grep -q '^byo_postgres_url' "$tfv" 2>/dev/null; then
|
|
163
|
+
local found
|
|
164
|
+
found=$(grep '^#[[:space:]]*existing_pg_cluster_name' "$tfv" | sed -E 's/.*"([^"]+)".*/\1/')
|
|
165
|
+
if [ -n "$found" ]; then
|
|
166
|
+
echo ""
|
|
167
|
+
echo -e " ${CYAN}${BOLD}Your account already has a PostgreSQL cluster.${NC}"
|
|
168
|
+
echo -e " ${DIM}$found${NC}"
|
|
169
|
+
echo ""
|
|
170
|
+
echo -e " ${DIM}The difference is what happens when this universe is torn down.${NC}"
|
|
171
|
+
echo ""
|
|
172
|
+
pick_option "Reuse it this universe gets its own database inside it. The cluster is NOT part of the stack: destroying the universe leaves it running" \
|
|
173
|
+
"Create one for this universe part of the stack, built and destroyed with it (~\$15/month)"
|
|
174
|
+
if [ "$PICKED" = "0" ]; then
|
|
175
|
+
node -e 'const fs=require("fs");const[f,c]=process.argv.slice(1);let s=fs.readFileSync(f,"utf8");s=s.replace(/^#\s*(existing_pg_cluster_name\s*=.*)$/m,"$1");fs.writeFileSync(f,s)' "$tfv" "$found"
|
|
176
|
+
ok "Reusing $found"
|
|
177
|
+
else
|
|
178
|
+
ok "A new database will be created"
|
|
179
|
+
fi
|
|
180
|
+
fi
|
|
181
|
+
fi
|
|
182
|
+
|
|
155
183
|
_tf_fill docr_token DOCR_TOKEN "Registry access token (from your Unoverse admin)"
|
|
156
184
|
_tf_fill openai_api_key OPENAI_API_KEY "OPENAI_API_KEY (powers the platform's AI)"
|
|
157
185
|
if grep -q '^auth_issuer[[:space:]]*=[[:space:]]*"FILL_ME"' "$tfv" 2>/dev/null; then
|
package/package.json
CHANGED