BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | #Stop all running containers |
| 4 | docker kill "$(docker ps -q -a)" |
| 5 | docker rm "$(docker ps -q -a)" |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 6 | docker system prune -f |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 7 | |
BjornMagnussonXA | 90b0974 | 2019-04-16 12:10:40 +0000 | [diff] [blame] | 8 | # Clone Simulators for DFC from integration repo. |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 9 | mkdir -p $WORKSPACE/archives/dfc |
| 10 | cd $WORKSPACE/archives/dfc |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 11 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 12 | |
| 13 | if [ -z "$SIM_ROOT" ] |
| 14 | then |
yanhuanwang | 9665fde | 2019-09-09 21:01:31 +0200 | [diff] [blame] | 15 | git clone --depth 1 https://gerrit.onap.org/r/integration -b master |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 16 | #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 |
| 21 | else |
| 22 | echo "Using SIM_ROOT from environmental variable: " $SIM_ROOT |
| 23 | fi |
| 24 | |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 25 | #Location of the above simulators when run as a group. For start+config and stop. |
| 26 | SIMGROUP_ROOT=$SIM_ROOT/simulator-group |
| 27 | |
| 28 | #Default IP for all containers |
| 29 | SIM_IP="127.0.0.1" |
| 30 | #Location of script to start and stop dfc |
| 31 | DFC_ROOT=$WORKSPACE/scripts/dcaegen2-collectors-datafile/dfc-management |
| 32 | |
| 33 | #Make the env vars availble to the robot scripts |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 34 | ROBOT_VARIABLES="-b debug.log -v SIMGROUP_ROOT:${SIMGROUP_ROOT} -v SIM_IP:${SIM_IP} -v DFC_ROOT:${DFC_ROOT}" |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 39 | |
| 40 | #Build needed simulator images. DR and MR simulators |
| 41 | |
| 42 | cd $SIM_ROOT/mr-sim |
| 43 | |
| 44 | docker build -t mrsim:latest . |
| 45 | |
| 46 | cd $SIM_ROOT/dr-sim |
| 47 | |
| 48 | docker build -t drsim_common:latest . |
| 49 | |
| 50 | #Prepare the ftp simulator files. |
| 51 | |
| 52 | cd $SIMGROUP_ROOT |
| 53 | |
| 54 | #Copy ftp config for the ftp servers |
| 55 | cp -r ../ftps-sftp-server/configuration . |
| 56 | cp -r ../ftps-sftp-server/tls . |
| 57 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 58 | cd ../ftps-sftp-server |
| 59 | docker build -t ftps_vsftpd:latest -f Dockerfile-ftps . |
| 60 | |
| 61 | |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 62 | #All containers will be started and stopped via the robot tests. |
| 63 | |