summaryrefslogtreecommitdiffstats
path: root/ci/rubbos_docker_run.sh
blob: 2eb3e16c912d044c06fd6b359c5b030f850d7a0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

set -ex

docker build -t opnfv/bottlenecks ${BOTTLENECKS_TOP_DIR}/ci/docker/

if [ x"${GERRIT_REFSPEC_DEBUG}" != x ]; then
    opts="--privileged=true"
    BOTTLENECKS_BRANCH=${GERRIT_REFSPEC_DEBUG}
else
    opts="--privileged=true --rm"
    BOTTLENECKS_BRANCH=${GIT_BRANCH##origin/}
fi

envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NET=${EXTERNAL_NETWORK} -e BOTTLENECKS_BRANCH=${BOTTLENECKS_BRANCH} -e GERRIT_REFSPEC_DEBUG=${GERRIT_REFSPEC_DEBUG} -e BOTTLENECKS_DB_TARGET=${BOTTLENECKS_DB_TARGET} -e PACKAGE_URL=${PACKAGE_URL}"
volumes="-v ${BOTTLENECKS_TOP_DIR}:${BOTTLENECKS_TOP_DIR}"
run_rubbos_testsuite=${BOTTLENECKS_TOP_DIR}/run_tests.sh -s rubbos

echo ${envs} ${ops} ${volumes}

# Run docker
cmd="sudo docker run ${opts} ${envs} ${volumes} opnfv/bottlenecks ${run_rubbos_testsuite}"
echo "Bottlenecks: Running docker cmd: ${cmd}"
${cmd}

echo "Bottlenecks: done!"

set +ex