github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/scripts/comparator/docker-setup.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -xe
     4  
     5  REVISION=$(git rev-parse HEAD)
     6  COMPOSE_FILE=$GOPATH/src/github.com/m3db/m3/scripts/comparator/docker-compose.yml
     7  export REVISION
     8  
     9  function setup_docker {
    10    echo "Run m3query, m3comparator, and prometheus containers"
    11    docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes m3comparator
    12    docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes prometheus
    13    docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes m3query 
    14    
    15    CI=$1
    16    if [[ "$CI" != "true" ]]
    17    then
    18      echo "run grafana container"
    19      docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes grafana
    20    fi
    21  }
    22  
    23  function teardown_docker {
    24    CI=$1
    25     # CI fails to stop all containers sometimes
    26    if [[ "$CI" == "true" ]]
    27    then
    28      docker-compose -f ${COMPOSE_FILE} down || echo "unable to shutdown containers"
    29    fi
    30  }