Update Variable Naming Convention

Variables in qemu-build.sh, build-jenkins.sh, build-setup.sh,
and kubernetes-launch.sh updated to use the same convention across
different scripts.

Change-Id: Ice9ef2f47b0fbf125eadd235f63b79abafdc2dd7
Signed-off-by: Alanny Lopez <alannyglopez@gmail.com>
diff --git a/kubernetes/kubernetes-launch.sh b/kubernetes/kubernetes-launch.sh
index 3917a92..fd8e95c 100755
--- a/kubernetes/kubernetes-launch.sh
+++ b/kubernetes/kubernetes-launch.sh
@@ -24,28 +24,28 @@
 #                     Default: The parent directory containing this script
 #
 # Kubernetes Variables:
-#  imgplsec           The image pull secret used to access registry if needed
+#  img_pl_sec         The image pull secret used to access registry if needed
 #                     Default: "regkey"
-#  imgrepo            The registry to use to pull and push images
+#  registry           The registry to use to pull and push images
 #                     Default: "master.cfc:8500/openbmc/""
-#  jobtimeout         The amount of time in seconds that the build will wait for
+#  job_timeout         The amount of time in seconds that the build will wait for
 #                     the job to be created in the api of the cluster.
 #                     Default: "60"
 #  namespace          The namespace to be used within the Kubernetes cluster
 #                     Default: "openbmc"
-#  podtimeout         The amount of time in seconds that the build will wait for
+#  pod_timeout        The amount of time in seconds that the build will wait for
 #                     the pod to start running on the cluster.
 #                     Default: "600"
 #
 # YAML File Variables (No Defaults):
-#  imgname            The name the image that will be passed to the kubernetes
+#  img_name           The name the image that will be passed to the kubernetes
 #                     api to build the containers. The image with the tag
-#                     imgname will be built in the invoker script. This script
+#                     img_name will be built in the invoker script. This script
 #                     will then tag it to include the registry in the name, push
-#                     it, and update the imgname to be what was pushed to the
+#                     it, and update the img_name to be what was pushed to the
 #                     registry. Users should not include the registry in the
-#                     original imgname.
-#  podname            The name of the pod, needed to trace down the logs.
+#                     original img_name.
+#  pod_name           The name of the pod, needed to trace down the logs.
 #
 # Deployment Option Variables (No Defaults):
 #  invoker            Name of what this script is being called by or for, used
@@ -71,10 +71,10 @@
 
 # Kubernetes Variables
 namespace=${namespace:-openbmc}
-imgrepo=${imgrepo:-master.cfc:8500/openbmc/}
-imgplsec=${imgplsec:-regkey}
-jobtimeout=${jobtimeout:-60}
-podtimeout=${podtimeout:-600}
+registry=${registry:-master.cfc:8500/openbmc/}
+img_pl_sec=${img_pl_sec:-regkey}
+job_timeout=${job_timeout:-60}
+pod_timeout=${pod_timeout:-600}
 
 # Options which decide script behavior
 invoker=${invoker:-${1}}
@@ -87,25 +87,25 @@
 # Other variables in the template not declared here are declared by invoker
 case ${invoker} in
   OpenBMC-build)
-    wclaim=${wclaim:-jenkins-slave-space}
-    sclaim=${sclaim:-shared-state-cache}
-    oclaim=${oclaim:-openbmc-reference-repo}
-    newimgname=${newimgname:-${imgrepo}${distro}:${imgtag}-${ARCH}}
-    podname=${podname:-openbmc${BUILD_ID}-${target}-builder}
+    w_claim=${w_claim:-jenkins-slave-space}
+    s_claim=${s_claim:-shared-state-cache}
+    o_claim=${o_claim:-openbmc-reference-repo}
+    new_img_name=${new_img_name:-${registry}${distro}:${img_tag}-${ARCH}}
+    pod_name=${pod_name:-openbmc${BUILD_ID}-${target}-builder}
     ;;
   QEMU-build)
-    podname=${podname:-qemubuild${BUILD_ID}}
-    wclaim=${wclaim:-jenkins-slave-space}
-    qclaim=${qclaim:-qemu-repo}
-    newimgname="${imgrepo}${imgname}"
+    pod_name=${pod_name:-qemubuild${BUILD_ID}}
+    w_claim=${w_claim:-jenkins-slave-space}
+    q_claim=${q_claim:-qemu-repo}
+    new_img_name="${registry}${img_name}"
     ;;
   QEMU-launch)
-    deployname=${deployname:-qemu-launch-deployment}
-    podname=${podname:-qemu-instance}
+    deploy_name=${deploy_name:-qemu-launch-deployment}
+    pod_name=${pod_name:-qemu-instance}
     replicas=${replicas:-5}
-    wclaim=${wclaim:-jenkins-slave-space}
+    w_claim=${w_claim:-jenkins-slave-space}
     jenkins_subpath=${jenkins_subpath:-Openbmc-Build/openbmc/build}
-    newimgname="${imgrepo}qemu-instance"
+    new_img_name="${registry}qemu-instance"
     ;;
   XCAT-launch)
     ;;
@@ -116,12 +116,12 @@
     ;;
 esac
 
-# Tag the image created by the invoker with a name that includes the imgrepo
-docker tag ${imgname} ${newimgname}
-imgname=${newimgname}
+# Tag the image created by the invoker with a name that includes the registry
+docker tag ${img_name} ${new_img_name}
+img_name=${new_img_name}
 
 # Push the image that was built to the image repository
-docker push ${imgname}
+docker push ${img_name}
 
 if [[ "$ARCH" == x86_64 ]]; then
   ARCH=amd64
@@ -132,53 +132,53 @@
   extras+="-v2"
 fi
 
-yamlfile=$(eval "echo \"$(<${build_scripts_dir}/kubernetes/Templates/${invoker}-${launch}${extras}.yaml)\"")
-kubectl create -f - <<< "${yamlfile}"
+yaml_file=$(eval "echo \"$(<${build_scripts_dir}/kubernetes/Templates/${invoker}-${launch}${extras}.yaml)\"")
+kubectl create -f - <<< "${yaml_file}"
 
-# If launch is a job we have to find the podname with identifiers
+# If launch is a job we have to find the pod_name with identifiers
 if [[ "${launch}" == "job" ]]; then
   while [ -z ${replace} ]
   do
-    if [ ${jobtimeout} -lt 0 ]; then
-      kubectl delete -f - <<< "${yamlfile}"
+    if [ ${job_timeout} -lt 0 ]; then
+      kubectl delete -f - <<< "${yaml_file}"
       echo "Timeout occurred before job was present in the API"
       exit 1
     else
       sleep 1
-      let jobtimeout-=1
+      let job_timeout-=1
     fi
-    replace=$(kubectl get pods -n ${namespaces} | grep ${podname} | awk 'print $1')
+    replace=$(kubectl get pods -n ${namespaces} | grep ${pod_name} | awk 'print $1')
   done
-  podname=${replace}
+  pod_name=${replace}
 fi
 
 
 # Once pod is running track logs
 if [[ "${log}" == true ]]; then
   # Wait for Pod to be running
-  checkstatus="kubectl describe pod ${podname} -n ${namespace}"
-  status=$( ${checkstatus} | grep Status: )
+  check_status="kubectl describe pod ${pod_name} -n ${namespace}"
+  status=$( ${check_status} | grep Status: )
   while [ -z "$( echo ${status} | grep Running)" ]
   do
-    if [ ${podtimeout} -lt 0 ]; then
-      kubectl delete -f - <<< "${yamlfile}"
+    if [ ${pod_timeout} -lt 0 ]; then
+      kubectl delete -f - <<< "${yaml_file}"
       echo "Timeout occurred before pod was Running"
       exit 1
     else
       sleep 1
-      let podtimeout-=1
+      let pod_timeout-=1
     fi
-    status=$( ${checkstatus} | grep Status: )
+    status=$( ${check_status} | grep Status: )
   done
   # Tail the logs of the pod, if workaround enabled start executing build script instead.
   if [[ "${workaround}" == "true" ]]; then
-    kubectl exec -it ${podname} -n ${namespace} ${WORKSPACE}/build.sh
+    kubectl exec -it ${pod_name} -n ${namespace} ${WORKSPACE}/build.sh
   else
-    kubectl logs -f ${podname} -n ${namespace}
+    kubectl logs -f ${pod_name} -n ${namespace}
   fi
 fi
 
 # Delete the object if purge is true
 if [[ "${purge}" == true ]]; then
-  kubectl delete -f - <<< "${yamlfile}"
+  kubectl delete -f - <<< "${yaml_file}"
 fi