blob: 587b268082c13d50cfd83a13cdc38ef2cf9d7c62 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/usr/bin/env bash
2
3set -euo pipefail
4
5if [[ $# -eq 1 ]] && [[ $1 == "local-test-run" ]]; then
6 echo "Building locally - assuming all dependencies are installed"
7 export DOCKER_REGISTRY=""
8 export DOCKER_REGISTRY_PREFIX=""
9 export WORKSPACE=$(git rev-parse --show-toplevel)
10else
11 echo "Default run - install all dependencies"
12
13 pip uninstall -y docker-py
14 pip install docker
15
16 COMPOSE_VERSION=1.22.0
17 COMPOSE_LOCATION='/usr/local/bin/docker-compose'
18 sudo curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o ${COMPOSE_LOCATION}
19 sudo chmod +x ${COMPOSE_LOCATION}
20
21 export DOCKER_REGISTRY="nexus3.onap.org:10001"
22 export DOCKER_REGISTRY_PREFIX="${DOCKER_REGISTRY}/"
23fi
24
25echo "Removing not used docker networks"
26docker network prune -f
27
28export CONTAINERS_NETWORK=ves-hv-default
29echo "Creating network for containers: ${CONTAINERS_NETWORK}"
30docker network create ${CONTAINERS_NETWORK}
31
32cd ssl
33./gen-certs.sh
34cd ..
35
36docker-compose up -d
37
38mkdir -p ${WORKSPACE}/archives/containers_logs
39
Gary Wu13111e92018-09-27 11:31:33 -070040export ROBOT_VARIABLES="--pythonpath ${WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/libraries"