blob: 900ccf660a867dd3387c76123e6aa0349c24a4dc [file] [log] [blame]
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -06001#!/bin/bash
2#
3# Copyright 2016-2017 Huawei Technologies Co., Ltd.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18#
19# add here eventual scripts needed for music
20#
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060021echo "# music scripts calling";
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060022source ${WORKSPACE}/test/csit/scripts/music/music-scripts/music_script.sh
23
24#
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060025# add here all the configuration steps eventually needed to be carried out for music CSIT testing
26#
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060027echo "# music configuration step";
Leonardo Bellinide47fd42018-03-07 12:07:30 -060028MUSIC_SOURCE_PROPERTIES=${WORKSPACE}/test/csit/scripts/music/music-properties
29MUSIC_PROPERTIES=/tmp/music/properties
30MUSIC_LOGS=/tmp/music/logs
31
32mkdir -p ${MUSIC_PROPERTIES}
33mkdir -p ${MUSIC_LOGS}
34
35cp ${MUSIC_SOURCE_PROPERTIES}/* ${MUSIC_PROPERTIES}
36
37#docker cp /home/lb7254/integration/test/csit/scripts/music/music-scripts/music_init.cql cassandra:/tmp/music_init.cql
38#docker cp ${WORKSPACE}/test/csit/scripts/music/music-scripts/music_init.cql cassandra:/tmp/music_init.cql
39#docker exec -it cassandra /usr/bin/cqlsh -umusic -pmusic -f /tmp/music_init.cql
40
41
42
43#
44# add here below the start of all docker containers needed for music CSIT testing
45#
46echo "# music docker containers spinoff";
47
48
Leonardo Bellini293263e2018-03-09 07:34:07 -060049docker volume create --name music-vol
Leonardo Bellinide47fd42018-03-07 12:07:30 -060050docker run -d --name music-war -v music-vol:/app nexus3.onap.org:10001/onap/music/music:latest
51docker run -d --name music-db -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 nexus3.onap.org:10001/onap/music/cassandra_music:latest
52docker run -d --name music-zk -p 2181:2181 -p 2888:2888 -p 3888:3888 nexus3.onap.org:10001/library/zookeeper:3.4
53sleep 30
54
55CASSA_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-db`
56echo "CASSANDRA_IP=${CASSA_IP}"
57
58ZOO_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-zk`
59echo "ZOOKEEPER_IP=${ZOO_IP}"
60
61${WORKSPACE}/test/csit/scripts/music/music-scripts/wait_for_port.sh ${CASSA_IP} 9042
62
63docker run -d --name music-tomcat -p 8080:8080 -v music-vol:/usr/local/tomcat/webapps -v ${MUSIC_PROPERTIES}:/opt/app/music/etc:ro -v ${MUSIC_LOGS}:/opt/app/music/logs nexus3.onap.org:10001/library/tomcat:8.0
Leonardo Bellini293263e2018-03-09 07:34:07 -060064sleep 10
Leonardo Bellinide47fd42018-03-07 12:07:30 -060065
66TOMCAT_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat`
67echo "TOMCAT_IP=${TOMCAT_IP}"
68
Leonardo Bellini293263e2018-03-09 07:34:07 -060069${WORKSPACE}/test/csit/scripts/music/music-scripts/wait_for_port.sh ${TOMCAT_IP} 8080
Leonardo Bellinide47fd42018-03-07 12:07:30 -060070
71
72--- old part: it will be removed
73#docker run --name cassandra -d -p 9042:9042 -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9160:9160 nexus3.onap.org:10001/library/cassandra
74#docker run --name zookeeper -d -p 2181:2181 -p 2888:2888 -p 3888:3888 nexus3.onap.org:10001/library/zookeeper
75#docker run --name music -d -v /app nexus3.onap.org:10001/music
76#docker run --name tomcat -d -p 8080:8080 --volumes-from music nexus3.onap.org:10001/library/tomcat
77
78
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060079
80
81#
82# add here all ROBOT_VARIABLES settings
83#
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060084echo "# music robot variables settings";
Leonardo Bellini293263e2018-03-09 07:34:07 -060085ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://${TOMCAT_IP} -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://localhost -v COND_PORT:8091"
Leonardo Bellini4dfc5ca2018-03-01 10:56:57 -060086
87echo ${ROBOT_VARIABLES}
88
89
90