blob: d553b1d4fbc5e702b4a4ecf55149e73137f04116 [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
Filip Krzywka83cb2472019-03-20 13:38:17 +010016 COMPOSE_VERSION=1.23.2
Gary Wu9abb61c2018-09-27 10:38:50 -070017 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
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010032cd collector/ssl
Gary Wu9abb61c2018-09-27 10:38:50 -070033./gen-certs.sh
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010034cd ../..
Gary Wu9abb61c2018-09-27 10:38:50 -070035
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"