From fd22fb6db278c5fa6bc96c20df3ca33fecaa7702 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Sat, 16 Mar 2019 23:16:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=93context=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=97=B6=EF=BC=8Ceaszctl=20setup=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=AE=89=E8=A3=85=E5=9C=A8default=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/easzctl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/easzctl b/tools/easzctl index 113925d..0af3871 100755 --- a/tools/easzctl +++ b/tools/easzctl @@ -240,11 +240,13 @@ function checkout() { } function setup() { - [ -d "$BASEPATH/.cluster" ] || { echo "[ERROR] invalid context, run 'easzctl checkout ' first"; return 1; } - save_context [ -f "$BASEPATH/bin/kube-apiserver" ] || { echo "[ERROR] no binaries found, download then fist"; return 1; } [ -f "$BASEPATH/hosts" ] || { echo "[ERROR] no ansible hosts found, read 'docs/setup/00-planning_and_overall_intro.md'"; return 1; } - echo -e "\n[INFO] setup begin in 5s, press 'Enter' to abort\n:" + [ -d "$BASEPATH/.cluster" ] || checkout default + save_context + CLUSTER=$(cat $BASEPATH/.cluster/current_cluster) + echo -e "\n[INFO] setup cluster with context: $CLUSTER" + echo -e "[INFO] setup begin in 5s, press 'Enter' to abort\n:" ! (read -t 5 ANS) || { echo "[WARN] setup aborted"; return 1; } ansible-playbook $BASEPATH/90.setup.yml }