summaryrefslogtreecommitdiffstats
path: root/integration/storperf/storperf_docker.sh
blob: 629a4edbeab3744859363a28c37476edccdc751d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/bash
##############################################################################
# Copyright (c) 2017 ZTE and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

clean_storperf_container()
{
    docker-compose -f storperf-docker-compose.yaml down

    for container_name in storperf storperf-master storperf-swaggerui storperf-httpfrontend storperf-reporting
    do
        container=`docker ps -a -q -f name=$container_name`
        if [[ ! -z $container ]];then
            echo "Stopping any existing $container_name container"
            docker rm -fv $container
        fi
    done
}


launch_storperf_container()
{
    docker-compose -f storperf-docker-compose.yaml up -d

    echo "Waiting for StorPerf to become active"

    while [ $(curl -s -o /dev/null -I -w "%{http_code}" -X GET http://127.0.0.1:5000/api/v1.0/configurations) != "200" ]
    do
        sleep 1
    done
}