From d8f9ed90e6f40221a6d48a2fdca7cf521d3b13e9 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Sun, 3 Feb 2019 21:19:39 -0800 Subject: [PATCH] Improve script a little bit. --- examples/createPod.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/examples/createPod.sh b/examples/createPod.sh index 4987adbf82..18a9841317 100755 --- a/examples/createPod.sh +++ b/examples/createPod.sh @@ -1,11 +1,26 @@ -#creates a pod and runs Example.java(list pods for all namespaces) on starting of pod -export REPO_ROOT=$(pwd)/../ +#!/bin/bash -cd ${REPO_ROOT}/kubernetes +# creates a pod and runs +# Example.java(list pods for all namespaces) on starting of pod + +# Exit on any error. +set -e + +if ! which minikube > /dev/null; then + echo "This script requires minikube installed." + exit 100 +fi + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +export REPO_ROOT=${dir}/.. + +cd ${REPO_ROOT} mvn install cd ${REPO_ROOT}/examples mvn package + eval $(minikube docker-env) docker build -t test/examples:1.0 . kubectl apply -f test.yaml