Offline procedure preparations, p2

   Related-PROD: PROD-36856

Change-Id: I44a1d6217271deb7388bf151cc37c48e281fa4f1
diff --git a/k8s/workspace/init-workspace.sh b/k8s/workspace/init-workspace.sh
index ad35877..92de28c 100644
--- a/k8s/workspace/init-workspace.sh
+++ b/k8s/workspace/init-workspace.sh
@@ -22,6 +22,7 @@
 
 ### prepare needed variables
 echo "# Updating '$MY_PROJFOLDER/env.sh'"
+
 export KUBECONFIG=$MY_PROJFOLDER/envs/mcc-kubeconfig.yaml
 if [ ! -f $MY_PROJFOLDER/env.sh ]; then
 	touch $MY_PROJFOLDER/env.sh
@@ -29,15 +30,18 @@
 	truncate -s 0 $MY_PROJFOLDER/env.sh
 	echo "$MY_PROJFOLDER/env.sh has been truncated"
 fi
-
+ewriteln "export MY_CLIENTNAME='ClientName'"
+ewriteln "export MY_CLIENTSHORTNAME='clname'"
+ewriteln "export MY_PROJNAME='MOS_DEPLOY'"
 ewriteln "export MY_PROJFOLDER=/artifacts"
+
 # NS & CLUSTER
 cls=$(kubectl get cluster -A --no-headers | grep -v default)
 declare nn=()
 tifs=$IFS
 IFS=" "
-echo $cls | cut -d" " -f1-2 | while read -r -a nn;
-do
+echo $cls | cut -d" " -f1-2 | while read -r -a nn; 
+do 
     ewriteln "export MOS_NS=$(echo ${nn[0]})"
     ewriteln "export MOS_CLUSTER=$(echo ${nn[1]})"
 done
@@ -49,7 +53,6 @@
 ewriteln "export TEMPEST_CUSTOM_PUBLIC_NET=public"
 ewriteln "export TEMPEST_CUSTOM_IMAGE=cvp.cirros.51"
 ewriteln "export TEMPEST_CUSTOM_IMAGE_ALT=cvp.cirros.52"
-ewriteln 'export TEMPEST_CUSTOM_PARAMETERS=$(cat /artifacts/yamls/tempest_custom.yaml)'
 
 # extract MOS kubeconfig
 echo " "
@@ -64,6 +67,21 @@
 echo "Preparing additional files"
 # copy files
 cp -v /opt/res-files/k8s/workspace/* $MY_PROJFOLDER/envs/
+mkdir $MY_PROJFOLDER/scripts
+mv $MY_PROJFOLDER/envs/*.sh $MY_PROJFOLDER/scripts/
+# update IP Addresses
+mccip=$(cat $MY_PROJFOLDER/envs/mcc-kubeconfig.yaml | grep server | cut -d':' -f3 | cut -d'/' -f3)
+echo "-> MCC Server IP is: ${mccip}"
+sed -i "s/ip_address/$mccip/g" $MY_PROJFOLDER/envs/mcc-checker.env
+
+if [ -f $MY_PROJFOLDER/envs/mos-kubeconfig.yaml ]; then
+    mosip=$(cat $MY_PROJFOLDER/envs/mos-kubeconfig.yaml | grep server | cut -d':' -f3 | cut -d'/' -f3)
+    echo "-> MOS Server IP is: ${mosip}"
+    sed -i "s/ip_address/$mosip/g" $MY_PROJFOLDER/envs/mos-checker.env
+    #prepare tempest custom yaml
+    cp /opt/res-files/k8s/yamls/tempest_custom.yaml.clean $MY_PROJFOLDER/yamls/tempest_custom.yaml
+    ewriteln 'export TEMPEST_CUSTOM_PARAMETERS=$(cat $MY_PROJFOLDER/yamls/tempest_custom.yaml)'
+fi
 
 # end
 echo " "
diff --git a/k8s/workspace/mcc-checker.env b/k8s/workspace/mcc-checker.env
index 6f789b2..0d16295 100644
--- a/k8s/workspace/mcc-checker.env
+++ b/k8s/workspace/mcc-checker.env
@@ -4,7 +4,7 @@
 # in order set options and user for the ssh, 
 # please, use ~/.ssh/config
 # SSH hostname of salt/k8s master node
-MCP_SSH_KEY=/Users/savex/proj/avature-mcc/envs/node.key
+MCP_SSH_KEY=/artifacts/envs/node.key
 MCP_SSH_USER=mcc-user
 MCP_SSH_HOST=ip_address
 MCP_ENV_HOST=ip_address