unoverse 0.1.58 → 0.1.59
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 +17 -1
- package/package.json +1 -1
package/operator/lib/deploy.sh
CHANGED
|
@@ -106,7 +106,23 @@ cmd_deploy() {
|
|
|
106
106
|
info "When ready: cd infra/$cloud && terraform init && terraform apply && cd ../.. && unoverse deploy"
|
|
107
107
|
exit 0
|
|
108
108
|
fi
|
|
109
|
-
|
|
109
|
+
# Terraform is one static binary: install it directly from the official release
|
|
110
|
+
# rather than sending anyone to brew (whose compile chain can demand Xcode Command
|
|
111
|
+
# Line Tools updates for a tool that needs no compiling).
|
|
112
|
+
if ! command -v terraform >/dev/null 2>&1; then
|
|
113
|
+
local REPLY2 tf_arch tf_os tf_v="1.9.8" tf_dir
|
|
114
|
+
read -r -p " Terraform is needed. Install it now (official binary, ~30 MB)? [Y/n] " REPLY2
|
|
115
|
+
[[ "$REPLY2" =~ ^[Nn]$ ]] && { fail "terraform is needed to continue"; exit 1; }
|
|
116
|
+
tf_arch=$(uname -m); [ "$tf_arch" = "arm64" ] || [ "$tf_arch" = "aarch64" ] && tf_arch=arm64 || tf_arch=amd64
|
|
117
|
+
[ "$(uname -s)" = "Darwin" ] && tf_os=darwin || tf_os=linux
|
|
118
|
+
tf_dir=$(mktemp -d)
|
|
119
|
+
curl -fsSL -o "$tf_dir/tf.zip" "https://releases.hashicorp.com/terraform/${tf_v}/terraform_${tf_v}_${tf_os}_${tf_arch}.zip" && unzip -o -q "$tf_dir/tf.zip" -d "$tf_dir" || { fail "download failed"; exit 1; }
|
|
120
|
+
if [ -w /usr/local/bin ]; then mv "$tf_dir/terraform" /usr/local/bin/terraform
|
|
121
|
+
else sudo mv "$tf_dir/terraform" /usr/local/bin/terraform || { fail "could not install to /usr/local/bin"; exit 1; }
|
|
122
|
+
fi
|
|
123
|
+
rm -rf "$tf_dir"
|
|
124
|
+
ok "terraform $(terraform version | head -1 | awk '{print $2}') installed"
|
|
125
|
+
fi
|
|
110
126
|
terraform -chdir="$ROOT/infra/$cloud" init -input=false >/dev/null 2>&1 || { fail "terraform init failed"; exit 1; }
|
|
111
127
|
terraform -chdir="$ROOT/infra/$cloud" apply || { fail "apply did not complete. Re-run: unoverse deploy"; exit 1; }
|
|
112
128
|
echo ""
|
package/package.json
CHANGED