unoverse 0.1.71 → 0.1.73
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 +20 -3
- package/package.json +1 -1
package/operator/lib/deploy.sh
CHANGED
|
@@ -114,6 +114,20 @@ _ensure_ground_config() {
|
|
|
114
114
|
cur_size=$(grep -E '^size[[:space:]]*=' "$tfv" 2>/dev/null | sed -E 's/.*"([^"]+)".*/\1/')
|
|
115
115
|
[ -n "$cur_size" ] && info "Size: ${BOLD}${cur_size}${NC} ${DIM}(small · medium · large — change it in terraform.tfvars and deploy again whenever you outgrow it)${NC}"
|
|
116
116
|
|
|
117
|
+
# THE DATABASE DECISION, STATED EVERY RUN. It is asked once and then recorded in
|
|
118
|
+
# terraform.tfvars, so later deploys correctly do not re-ask — but silence reads
|
|
119
|
+
# exactly like never having been asked. Say what is in force, the same way Size does.
|
|
120
|
+
local pg_reuse pg_byo
|
|
121
|
+
pg_reuse=$(grep -E '^existing_pg_cluster_name[[:space:]]*=' "$tfv" 2>/dev/null | sed -E 's/.*"([^"]+)".*/\1/')
|
|
122
|
+
pg_byo=$(grep -cE '^byo_postgres_url[[:space:]]*=' "$tfv" 2>/dev/null)
|
|
123
|
+
if [ -n "$pg_reuse" ]; then
|
|
124
|
+
info "Database: ${BOLD}reusing $pg_reuse${NC} ${DIM}(no new cluster, nothing added to your bill)${NC}"
|
|
125
|
+
elif [ "$pg_byo" = "1" ]; then
|
|
126
|
+
info "Database: ${BOLD}your own URL${NC} ${DIM}(byo_postgres_url in terraform.tfvars)${NC}"
|
|
127
|
+
else
|
|
128
|
+
info "Database: ${BOLD}a new managed cluster${NC} ${DIM}(~\$15/month — comment in existing_pg_cluster_name to reuse one instead)${NC}"
|
|
129
|
+
fi
|
|
130
|
+
|
|
117
131
|
# STRAIGHT INTO TERRAFORM. Its plan plus its own typed "yes" IS the decision gate
|
|
118
132
|
# for billable infrastructure; a [Y/n] in front of it was asking permission to ask
|
|
119
133
|
# permission. Answering "no" is terraform's "no".
|
|
@@ -148,12 +162,15 @@ _ground_apply() {
|
|
|
148
162
|
|
|
149
163
|
# `read -p` does NOT interpret escapes, so ${DIM} printed as literal \033[2m. Colour
|
|
150
164
|
# the hint with echo -e first, then take a plain prompt.
|
|
165
|
+
# EXPLICIT YES, and it says so. Everywhere else in this CLI Enter means "go"; here it
|
|
166
|
+
# means "stop", because this is the one prompt that starts a monthly bill. Keeping the
|
|
167
|
+
# safety is right — leaving it as a bare [y/N] among Enter-means-go prompts is not.
|
|
151
168
|
local REPLY
|
|
152
|
-
echo -e " ${DIM}
|
|
153
|
-
read -r -p "
|
|
169
|
+
echo -e " ${DIM}d shows the full technical plan${NC}"
|
|
170
|
+
read -r -p " Type y to build this, or Enter to stop: " REPLY
|
|
154
171
|
if [[ "$REPLY" =~ ^[Dd]$ ]]; then
|
|
155
172
|
terraform -chdir="$dir" show "$planfile"
|
|
156
|
-
read -r -p "
|
|
173
|
+
read -r -p " Type y to build this, or Enter to stop: " REPLY
|
|
157
174
|
fi
|
|
158
175
|
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
|
|
159
176
|
info "Nothing was created. Run ${BOLD}unoverse deploy${NC} when you are ready"
|
package/package.json
CHANGED