diff options
author | QiLiang <liangqi1@huawei.com> | 2016-01-04 08:58:23 +0000 |
---|---|---|
committer | QiLiang <liangqi1@huawei.com> | 2016-01-04 10:37:03 +0000 |
commit | 4307f8d1d2653ea5ba2029bd7720c1ea6a8cdb76 (patch) | |
tree | 511496028517b2d0004d0588ccd5ba48f0dcf252 | |
parent | 09f9a968d1078dc64bd971dd4dcd005c2a05c0e4 (diff) |
Add ci run scirpts
JIRA: -
Change-Id: I94a0ea01fa7df0e279a605457148fdc4f3f03fb8
Signed-off-by: QiLiang <liangqi1@huawei.com>
-rwxr-xr-x | ci/run.sh | 17 | ||||
-rwxr-xr-x | utils/infra_setup/heat_template/HOT_create_instance.sh | 7 | ||||
-rwxr-xr-x | utils/infra_setup/vm_dev_setup/setup_env.sh | 7 |
3 files changed, 31 insertions, 0 deletions
diff --git a/ci/run.sh b/ci/run.sh new file mode 100755 index 00000000..07b25dff --- /dev/null +++ b/ci/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -ex + +BOTTLENECKS_REPO=https://gerrit.opnfv.org/gerrit/bottlenecks + +SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd` +GERRIT_REFSPEC_DEBUG=$1 + +if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then + git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD +fi + +$SCRIPT_DIR/../utils/infra_setup/heat_template/HOT_create_instance.sh $GERRIT_REFSPEC_DEBUG + +set +ex + diff --git a/utils/infra_setup/heat_template/HOT_create_instance.sh b/utils/infra_setup/heat_template/HOT_create_instance.sh index ecb9ab80..bcd9f048 100755 --- a/utils/infra_setup/heat_template/HOT_create_instance.sh +++ b/utils/infra_setup/heat_template/HOT_create_instance.sh @@ -2,6 +2,8 @@ set -ex +GERRIT_REFSPEC_DEBUG=$1 + bottlenecks_env_prepare() { if [ -d $BOTTLENECKS_REPO_DIR ]; then @@ -11,6 +13,9 @@ bottlenecks_env_prepare() mkdir -p ${BOTTLENECKS_REPO_DIR} git config --global http.sslVerify false git clone ${BOTTLENECKS_REPO} ${BOTTLENECKS_REPO_DIR} + if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then + git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD + fi source $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh chmod 600 $KEY_PATH/bottlenecks_key @@ -94,6 +99,8 @@ bottlenecks_rubbos_run() /etc/resolv.conf | awk '{ print $2 '}) echo "nameserver_ip=$nameserver_ip" >> $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf + echo "GERRIT_REFSPEC_DEBUG=$GERRIT_REFSPEC_DEBUG" >> $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf + scp $ssh_args -r \ $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup \ ec2-user@$control_ip:/tmp diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh index 52579e0d..8ba76600 100755 --- a/utils/infra_setup/vm_dev_setup/setup_env.sh +++ b/utils/infra_setup/vm_dev_setup/setup_env.sh @@ -51,10 +51,17 @@ bottlenecks_download_repo() if [ -d $BOTTELENECKS_REPO_DIR/.git ]; then cd $BOTTLENECKS_REPO_DIR sudo git pull origin master + if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then + sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD + fi cd - else sudo rm -rf $BOTTLENECKS_REPO_DIR sudo git clone $BOTTLENECKS_REPO $BOTTLENECKS_REPO_DIR + if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then + sudo git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD + fi + fi } |