From 01d2929e49f41ddfaebb0874150c49eb71165faf Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Fri, 5 Nov 2021 17:11:18 +0800 Subject: [PATCH] stx tool: Create mirrors directory and record the minikube variables Create the mirror directory before the minikube cluster is created otherwise it will be automatically created with root permission. Log the minikube varibales MINIKUBE_HOME, MINIKUBENAME and STX_BUILD_HOME into minikube_history.log. Story: 2008862 Task: 43862 Signed-off-by: Zhixiong Chi Change-Id: I72c877cc171f49633d8b1802834cf7da48a9e7b5 --- stx-init-env | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stx-init-env b/stx-init-env index 9e96dc2a9..aa112df1c 100755 --- a/stx-init-env +++ b/stx-init-env @@ -137,6 +137,12 @@ if [[ ! -d "$STX_BUILD_HOME" ]] ; then exit 1 fi +# Make sure mirror directory exists. If this directory doesn't exist, +# it will be automatically created with root permission. +if [[ ! -d "$STX_BUILD_HOME/mirrors/starlingx" ]] ; then + mkdir -p $STX_BUILD_HOME/mirrors/starlingx || exit 1 +fi + # --nuke: just delete the cluster and exit if [[ $DELETE_MINIKUBE -eq 1 ]] ; then if minikube_exists ; then @@ -175,6 +181,12 @@ if [[ $WANT_START_MINIKUBE -eq 1 ]] ; then || exit 1 fi +# Record the project environment variables +echo "The last minikube cluster startup date: `date`" > minikube_history.log +echo "MINIKUBE_HOME: $MINIKUBE_HOME" >> minikube_history.log +echo "MINIKUBENAME: $MINIKUBENAME" >> minikube_history.log +echo "STX_BUILD_HOME: $STX_BUILD_HOME" >> minikube_history.log + # Import minikube's docker environment eval $(minikube -p $MINIKUBENAME docker-env)