unoverse 0.1.46 → 0.1.48
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 +27 -6
- package/operator/lib/ground.sh +20 -5
- package/operator/lib/help.sh +1 -2
- package/package.json +1 -1
package/operator/lib/deploy.sh
CHANGED
|
@@ -23,15 +23,36 @@ cmd_deploy() {
|
|
|
23
23
|
done
|
|
24
24
|
fi
|
|
25
25
|
|
|
26
|
+
# NO SERVER YET is not an error, it is the first question. deploy owns the whole
|
|
27
|
+
# journey: pick the cloud right here (ground is no longer a command to know about),
|
|
28
|
+
# prefill its Terraform, and name the two commands left. `terraform apply` stays the
|
|
29
|
+
# developer's own explicit act — it creates billable infrastructure.
|
|
26
30
|
if [ ! -f "$env_prod" ]; then
|
|
27
|
-
fail ".env.production not found, and no applied Terraform ground to render it from"
|
|
28
31
|
echo ""
|
|
29
|
-
|
|
30
|
-
info " unoverse ground # prefill terraform.tfvars"
|
|
31
|
-
info " cd infra/digitalocean && terraform init && terraform apply # or infra/aws"
|
|
32
|
-
info " cd ../.. && unoverse deploy init"
|
|
32
|
+
echo -e " ${CYAN}${BOLD}Where should this universe live?${NC}"
|
|
33
33
|
echo ""
|
|
34
|
-
|
|
34
|
+
echo -e " ${CYAN}❯${NC} 1 ${BOLD}DigitalOcean${NC}"
|
|
35
|
+
echo -e " 2 AWS"
|
|
36
|
+
echo ""
|
|
37
|
+
local cloud_choice cloud
|
|
38
|
+
read -r -p " Enter to choose, or type 2: " cloud_choice
|
|
39
|
+
case "$cloud_choice" in
|
|
40
|
+
2) cloud=aws ;;
|
|
41
|
+
*) cloud=digitalocean ;;
|
|
42
|
+
esac
|
|
43
|
+
echo ""
|
|
44
|
+
cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || {
|
|
45
|
+
echo ""
|
|
46
|
+
info "Once that is sorted, run ${BOLD}unoverse deploy${NC} again. It picks up right here."
|
|
47
|
+
echo ""
|
|
48
|
+
exit 1
|
|
49
|
+
}
|
|
50
|
+
echo ""
|
|
51
|
+
info "Your $cloud ground is prefilled. Two commands left:"
|
|
52
|
+
info " cd infra/$cloud && terraform init && terraform apply ${DIM}# creates the server (billable)${NC}"
|
|
53
|
+
info " cd ../.. && unoverse deploy ${DIM}# ships the platform onto it${NC}"
|
|
54
|
+
echo ""
|
|
55
|
+
exit 0
|
|
35
56
|
fi
|
|
36
57
|
|
|
37
58
|
# Read deploy target from .env.production
|
package/operator/lib/ground.sh
CHANGED
|
@@ -18,11 +18,26 @@ _ground_do() {
|
|
|
18
18
|
local out="$dir/terraform.tfvars"
|
|
19
19
|
|
|
20
20
|
if ! command -v doctl >/dev/null 2>&1; then
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
# Offer to install rather than sending the developer away with homework: brew is
|
|
22
|
+
# already on most Macs that got this far. Their yes, their machine, our command.
|
|
23
|
+
if command -v brew >/dev/null 2>&1; then
|
|
24
|
+
local REPLY
|
|
25
|
+
read -r -p " doctl (the DigitalOcean CLI) is needed. Install it now with brew? [Y/n] " REPLY
|
|
26
|
+
if [[ ! "$REPLY" =~ ^[Nn]$ ]]; then
|
|
27
|
+
brew install doctl || { fail "brew install doctl failed"; return 1; }
|
|
28
|
+
ok "doctl installed"
|
|
29
|
+
else
|
|
30
|
+
fail "doctl is needed to continue"
|
|
31
|
+
info " https://docs.digitalocean.com/reference/doctl/how-to/install/"
|
|
32
|
+
return 1
|
|
33
|
+
fi
|
|
34
|
+
else
|
|
35
|
+
fail "doctl is not installed"
|
|
36
|
+
info " brew install doctl (macOS)"
|
|
37
|
+
info " https://docs.digitalocean.com/reference/doctl/how-to/install/"
|
|
38
|
+
info "Then authenticate: doctl auth init"
|
|
39
|
+
return 1
|
|
40
|
+
fi
|
|
26
41
|
fi
|
|
27
42
|
if ! doctl account get >/dev/null 2>&1; then
|
|
28
43
|
fail "doctl is not authenticated"
|
package/operator/lib/help.sh
CHANGED
|
@@ -22,8 +22,7 @@ cmd_help() {
|
|
|
22
22
|
echo -e " ${GREEN}stop${NC} Stop it"
|
|
23
23
|
echo -e " ${GREEN}check${NC} Is it healthy ${DIM}(services, schema, environment)${NC}"
|
|
24
24
|
echo -e " ${GREEN}logs${NC} What is it doing ${DIM}(unoverse logs <service> for one)${NC}"
|
|
25
|
-
echo -e " ${GREEN}
|
|
26
|
-
echo -e " ${GREEN}deploy${NC} Ship it to your server ${DIM}(images + your work + migrations)${NC}"
|
|
25
|
+
echo -e " ${GREEN}deploy${NC} Ship it to a server ${DIM}(first run asks which cloud)${NC}"
|
|
27
26
|
echo ""
|
|
28
27
|
# Owner-only lane. Printed ONLY when publish.sh is present, so a starter kit never
|
|
29
28
|
# advertises a command it does not have (sync-starter.sh deletes that file).
|
package/package.json
CHANGED