Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Filip Krzywka | 66e2ad6 | 2019-03-20 14:03:02 +0100 | [diff] [blame] | 2 | # ============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 Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 19 | |
| 20 | set -euo pipefail |
| 21 | |
Jakub Dudycz | f344afa | 2019-03-25 16:04:58 +0100 | [diff] [blame] | 22 | RUN_CSIT_LOCAL=${RUN_CSIT_LOCAL:-false} |
| 23 | |
Piotr Jaszczyk | 5e1e59d | 2019-04-04 14:08:33 +0200 | [diff] [blame^] | 24 | echo "Replacing obsolete 'docker-py' with 'docker' package" |
| 25 | pip uninstall -y docker-py |
| 26 | pip install docker |
| 27 | |
Jakub Dudycz | f344afa | 2019-03-25 16:04:58 +0100 | [diff] [blame] | 28 | if ${RUN_CSIT_LOCAL} ; then |
Piotr Jaszczyk | 5e1e59d | 2019-04-04 14:08:33 +0200 | [diff] [blame^] | 29 | echo "Local run" |
Jakub Dudycz | f344afa | 2019-03-25 16:04:58 +0100 | [diff] [blame] | 30 | source env_local.sh |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 31 | else |
Piotr Jaszczyk | 5e1e59d | 2019-04-04 14:08:33 +0200 | [diff] [blame^] | 32 | echo "Default (CI) run" |
Filip Krzywka | 83cb247 | 2019-03-20 13:38:17 +0100 | [diff] [blame] | 33 | COMPOSE_VERSION=1.23.2 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 34 | 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 Dudycz | f344afa | 2019-03-25 16:04:58 +0100 | [diff] [blame] | 37 | source env.sh |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 38 | fi |
| 39 | |
| 40 | echo "Removing not used docker networks" |
| 41 | docker network prune -f |
| 42 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 43 | echo "Creating network for containers: ${CONTAINERS_NETWORK}" |
| 44 | docker network create ${CONTAINERS_NETWORK} |
| 45 | |
Filip Krzywka | d2da2cc | 2019-03-20 10:42:19 +0100 | [diff] [blame] | 46 | cd collector/ssl |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 47 | ./gen-certs.sh |
Filip Krzywka | d2da2cc | 2019-03-20 10:42:19 +0100 | [diff] [blame] | 48 | cd ../.. |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 49 | |
| 50 | docker-compose up -d |
| 51 | |
| 52 | mkdir -p ${WORKSPACE}/archives/containers_logs |