blob: e0d0cc283846b89c6dfaa01aeb675a81f808d2c7 [file] [log] [blame]
kaihlavid1a1fb72019-06-13 16:11:48 +03001#!/bin/bash
2#
3# Copyright 2019 © Samsung Electronics 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
18set -x
19
20echo "This is ${WORKSPACE}/scripts/sdc/setup_sdc_dcaed.sh"
21
22# Clone sdc enviroment template
23mkdir -p ${WORKSPACE}/data/environments/
24mkdir -p ${WORKSPACE}/data/clone/
25cd ${WORKSPACE}/data/clone
26git clone --depth 1 http://gerrit.onap.org/r/sdc/dcae-d/dt-be-main
27git clone --depth 1 http://gerrit.onap.org/r/sdc
28
29chmod -R 777 ${WORKSPACE}/data/clone
30
31# set enviroment variables
32
33export ENV_NAME='CSIT'
34export MR_IP_ADDR='10.0.0.1'
35export TEST_SUITE=$1
36
37ifconfig
38IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'`
39export HOST_IP=$IP_ADDRESS
40
41# setup enviroment json
42
43cat ${WORKSPACE}/data/clone/sdc/sdc-os-chef/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > ${WORKSPACE}/data/environments/$ENV_NAME.json
44
45source ${WORKSPACE}/data/clone/sdc/version.properties
46export RELEASE=$major.$minor-STAGING-latest
47source ${WORKSPACE}/data/clone/dt-be-main/version.properties
48export DCAE_RELEASE=$major.$minor-STAGING-latest
49export DEP_ENV=$ENV_NAME
50
51cp ${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh ${WORKSPACE}/scripts/sdc/
52cp ${WORKSPACE}/data/clone/dt-be-main/docker/scripts/docker_run.sh ${WORKSPACE}/scripts/sdc/dcaed_docker_run.sh
53
54${WORKSPACE}/scripts/sdc/docker_run.sh -r ${RELEASE} -e ${ENV_NAME} -p 10001
55${WORKSPACE}/scripts/sdc/dcaed_docker_run.sh -r ${DCAE_RELEASE} -e ${ENV_NAME} -p 10001
56
57