unoverse 0.1.47 → 0.1.49
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 +6 -1
- package/operator/lib/ground.sh +34 -8
- package/package.json +1 -1
package/operator/lib/deploy.sh
CHANGED
|
@@ -41,7 +41,12 @@ cmd_deploy() {
|
|
|
41
41
|
*) cloud=digitalocean ;;
|
|
42
42
|
esac
|
|
43
43
|
echo ""
|
|
44
|
-
cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" ||
|
|
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
|
+
}
|
|
45
50
|
echo ""
|
|
46
51
|
info "Your $cloud ground is prefilled. Two commands left:"
|
|
47
52
|
info " cd infra/$cloud && terraform init && terraform apply ${DIM}# creates the server (billable)${NC}"
|
package/operator/lib/ground.sh
CHANGED
|
@@ -18,16 +18,42 @@ _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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
# Authenticate RIGHT HERE and keep going: doctl auth init is interactive anyway,
|
|
44
|
+
# so there is nothing to leave the flow for. The token comes from
|
|
45
|
+
# cloud.digitalocean.com/account/api (Generate New Token, read and write).
|
|
46
|
+
echo ""
|
|
47
|
+
info "doctl needs a DigitalOcean API token ${DIM}(cloud.digitalocean.com/account/api)${NC}"
|
|
48
|
+
echo ""
|
|
49
|
+
if ! doctl auth init; then
|
|
50
|
+
fail "authentication did not complete"
|
|
51
|
+
return 1
|
|
52
|
+
fi
|
|
53
|
+
if ! doctl account get >/dev/null 2>&1; then
|
|
54
|
+
fail "that token did not authenticate"
|
|
55
|
+
return 1
|
|
56
|
+
fi
|
|
31
57
|
fi
|
|
32
58
|
ok "doctl authenticated"
|
|
33
59
|
|
package/package.json
CHANGED