blob: 34baae8eef8525355692b81db617c26278efddff [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/usr/bin/env bash
Filip Krzywka66e2ad62019-03-20 14:03:02 +01002# ============LICENSE_START=======================================================
3# csit-dcaegen2-collectors-hv-ves
4# ================================================================================
5# Copyright (C) 2018-2019 NOKIA
6# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=========================================================
Gary Wu9abb61c2018-09-27 10:38:50 -070019
20set -euo pipefail
21
22if [[ $# -eq 1 ]] && [[ $1 == "local-test-run" ]]; then
23 echo "Building locally - assuming all dependencies are installed"
24 export DOCKER_REGISTRY=""
25 export DOCKER_REGISTRY_PREFIX=""
26 export WORKSPACE=$(git rev-parse --show-toplevel)
27else
28 echo "Default run - install all dependencies"
29
30 pip uninstall -y docker-py
31 pip install docker
32
Filip Krzywka83cb2472019-03-20 13:38:17 +010033 COMPOSE_VERSION=1.23.2
Gary Wu9abb61c2018-09-27 10:38:50 -070034 COMPOSE_LOCATION='/usr/local/bin/docker-compose'
35 sudo curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o ${COMPOSE_LOCATION}
36 sudo chmod +x ${COMPOSE_LOCATION}
37
38 export DOCKER_REGISTRY="nexus3.onap.org:10001"
39 export DOCKER_REGISTRY_PREFIX="${DOCKER_REGISTRY}/"
40fi
41
42echo "Removing not used docker networks"
43docker network prune -f
44
45export CONTAINERS_NETWORK=ves-hv-default
46echo "Creating network for containers: ${CONTAINERS_NETWORK}"
47docker network create ${CONTAINERS_NETWORK}
48
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010049cd collector/ssl
Gary Wu9abb61c2018-09-27 10:38:50 -070050./gen-certs.sh
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010051cd ../..
Gary Wu9abb61c2018-09-27 10:38:50 -070052
53docker-compose up -d
54
55mkdir -p ${WORKSPACE}/archives/containers_logs
56
Gary Wu13111e92018-09-27 11:31:33 -070057export ROBOT_VARIABLES="--pythonpath ${WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/libraries"