summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xci/rubbos_docker_run.sh4
-rwxr-xr-xutils/infra_setup/vm_dev_setup/setup_env.sh16
2 files changed, 11 insertions, 9 deletions
diff --git a/ci/rubbos_docker_run.sh b/ci/rubbos_docker_run.sh
index 3b0f041b..f1315e9e 100755
--- a/ci/rubbos_docker_run.sh
+++ b/ci/rubbos_docker_run.sh
@@ -6,11 +6,13 @@ docker build -t opnfv/bottlenecks ${BOTTLENECKS_TOP_DIR}/ci/docker/bottlenecks-c
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=${GIT_BRANCH##origin/} -e GERRIT_REFSPEC_DEBUG=${GERRIT_REFSPEC_DEBUG} -e BOTTLENECKS_DB_TARGET=${BOTTLENECKS_DB_TARGET} -e PACKAGE_URL=${PACKAGE_URL}"
+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}"
create_instance=${BOTTLENECKS_TOP_DIR}/utils/infra_setup/heat_template/HOT_create_instance.sh
diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh
index 1ddab5de..bfc8f724 100755
--- a/utils/infra_setup/vm_dev_setup/setup_env.sh
+++ b/utils/infra_setup/vm_dev_setup/setup_env.sh
@@ -53,13 +53,13 @@ bottlenecks_prepare_env()
git_checkout()
{
- if git cat-file -e $1^{commit} 2>/dev/null; then
+ if sudo git cat-file -e $1^{commit} 2>/dev/null; then
# branch, tag or sha1 object
- git checkout $1
+ sudo git checkout $1
else
# refspec / changeset
- git fetch --tags --progress $2 $1
- git checkout FETCH_HEAD
+ sudo git fetch --tags --progress $2 $1
+ sudo git checkout FETCH_HEAD
fi
}
@@ -69,12 +69,12 @@ bottlenecks_download_repo()
sudo git config --global http.sslVerify false
if [ ! -d $BOTTLENECKS_REPO_DIR ]; then
- git clone $BOTTLENECKS_REPO $BOTTLENECKS_REPO_DIR
+ sudo git clone $BOTTLENECKS_REPO $BOTTLENECKS_REPO_DIR
fi
- cd $BOTTLENECKS_REPO_DIR
- git checkout master && git pull
+ sudo cd $BOTTLENECKS_REPO_DIR
+ sudo git checkout master && sudo git pull
git_checkout $BOTTLENECKS_BRANCH $BOTTLENECKS_REPO
- cd -
+ sudo cd -
}
bottlenecks_config_hosts_ip()