blob: 73fdbc23eed3f606c1c6f187652063b539024fe2 [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
Jakub Dudyczf344afa2019-03-25 16:04:58 +010022RUN_CSIT_LOCAL=${RUN_CSIT_LOCAL:-false}
23
Piotr Jaszczyk5e1e59d2019-04-04 14:08:33 +020024echo "Replacing obsolete 'docker-py' with 'docker' package"
25pip uninstall -y docker-py
26pip install docker
27
Jakub Dudyczf344afa2019-03-25 16:04:58 +010028if ${RUN_CSIT_LOCAL} ; then
Piotr Jaszczyk5e1e59d2019-04-04 14:08:33 +020029 echo "Local run"
Jakub Dudyczf344afa2019-03-25 16:04:58 +010030 source env_local.sh
Gary Wu9abb61c2018-09-27 10:38:50 -070031else
Piotr Jaszczyk5e1e59d2019-04-04 14:08:33 +020032 echo "Default (CI) run"
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}
Jakub Dudyczf344afa2019-03-25 16:04:58 +010037 source env.sh
Gary Wu9abb61c2018-09-27 10:38:50 -070038fi
39
40echo "Removing not used docker networks"
41docker network prune -f
42
Gary Wu9abb61c2018-09-27 10:38:50 -070043echo "Creating network for containers: ${CONTAINERS_NETWORK}"
44docker network create ${CONTAINERS_NETWORK}
45
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010046cd collector/ssl
Gary Wu9abb61c2018-09-27 10:38:50 -070047./gen-certs.sh
Filip Krzywkad2da2cc2019-03-20 10:42:19 +010048cd ../..
Gary Wu9abb61c2018-09-27 10:38:50 -070049
50docker-compose up -d
51
52mkdir -p ${WORKSPACE}/archives/containers_logs