diff options
Diffstat (limited to 'ci/launch_docker_container.sh')
-rwxr-xr-x | ci/launch_docker_container.sh | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/ci/launch_docker_container.sh b/ci/launch_docker_container.sh index 2411ce0..ff28e05 100755 --- a/ci/launch_docker_container.sh +++ b/ci/launch_docker_container.sh @@ -8,32 +8,25 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -cd `dirname $0` -ci=`pwd` +cd "$(dirname "$0")" || exit 1 +ci=$(pwd) -cd ${ci}/../docker-compose +cd "${ci}/../docker-compose" || exit 1 -export ENV_FILE=${ci}/job/admin.rc -export CARBON_DIR=${ci}/job/carbon/ +export ENV_FILE="${ci}/job/admin.rc" +export CARBON_DIR="${ci}/job/carbon/" -if [ ! -d ${ci}/job/carbon ] +if [ ! -d "${ci}/job/carbon" ] then - mkdir ${ci}/job/carbon -fi - -if [ -z ${ARCH} ] -then - ARCH=x86_64 + mkdir -p "${ci}/job/carbon" fi +ARCH="${ARCH:-$(uname -m)}" export ARCH -if [ -z ${DOCKER_TAG} ] -then - DOCKER_TAG=latest -fi +DOCKER_TAG="${DOCKER_TAG:-latest}" -export TAG=${DOCKER_TAG} +export TAG="${ARCH}-${DOCKER_TAG}" docker-compose pull docker-compose up -d @@ -42,7 +35,7 @@ echo "Waiting for StorPerf to become active" ATTEMPTS=20 -while [ $(curl -s -o /dev/null -I -w "%{http_code}" -X GET http://127.0.0.1:5000/api/v1.0/configurations) != "200" ] +while [ "$(curl -s -o /dev/null -I -w '%{http_code}' -X GET http://127.0.0.1:5000/api/v1.0/configurations)" != "200" ] do ATTEMPTS=$((ATTEMPTS - 1)) if [ ${ATTEMPTS} -le 1 ] |