blob: 7736d4a76fc56ea42a2f3c2c12b5d186e2f0926a [file] [log] [blame]
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +00001#!/bin/bash
2
3#Stop all running containers
4docker kill "$(docker ps -q -a)"
5docker rm "$(docker ps -q -a)"
TamasBakaie81736c2019-08-23 13:31:57 +00006docker system prune -f
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +00007
BjornMagnussonXA90b09742019-04-16 12:10:40 +00008# Clone Simulators for DFC from integration repo.
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +00009mkdir -p $WORKSPACE/archives/dfc
10cd $WORKSPACE/archives/dfc
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000011
TamasBakaie81736c2019-08-23 13:31:57 +000012
13if [ -z "$SIM_ROOT" ]
14then
yanhuanwang9665fde2019-09-09 21:01:31 +020015 git clone --depth 1 https://gerrit.onap.org/r/integration -b master
TamasBakaie81736c2019-08-23 13:31:57 +000016 #Location of all individual simulators for DFC
17 echo "Determine SIM_ROOT based on the WORKSPACE"
18 SIM_ROOT=$WORKSPACE/archives/dfc/integration/test/mocks/datafilecollector-testharness
19
20 rm $SIM_ROOT/simulator-group/consul/consul/cbs_localhost_config.hcl || true
21else
22 echo "Using SIM_ROOT from environmental variable: " $SIM_ROOT
23fi
24
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000025#Location of the above simulators when run as a group. For start+config and stop.
26SIMGROUP_ROOT=$SIM_ROOT/simulator-group
27
28#Default IP for all containers
29SIM_IP="127.0.0.1"
30#Location of script to start and stop dfc
31DFC_ROOT=$WORKSPACE/scripts/dcaegen2-collectors-datafile/dfc-management
32
33#Make the env vars availble to the robot scripts
TamasBakaie81736c2019-08-23 13:31:57 +000034ROBOT_VARIABLES="-b debug.log -v SIMGROUP_ROOT:${SIMGROUP_ROOT} -v SIM_IP:${SIM_IP} -v DFC_ROOT:${DFC_ROOT}"
35
36
37
38
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000039
40#Build needed simulator images. DR and MR simulators
41
42cd $SIM_ROOT/mr-sim
43
44docker build -t mrsim:latest .
45
46cd $SIM_ROOT/dr-sim
47
48docker build -t drsim_common:latest .
49
50#Prepare the ftp simulator files.
51
52cd $SIMGROUP_ROOT
53
54#Copy ftp config for the ftp servers
Remigiusz Janeczekfae33f22020-07-27 15:22:57 +020055cp -r ../ftpes-sftp-server/configuration .
56cp -r ../ftpes-sftp-server/tls .
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000057
Remigiusz Janeczekfae33f22020-07-27 15:22:57 +020058cd ../ftpes-sftp-server
59docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes .
TamasBakaie81736c2019-08-23 13:31:57 +000060
61
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000062#All containers will be started and stopped via the robot tests.
63