From 16845921af46eae4b813cf69dcfe863caf4a489c Mon Sep 17 00:00:00 2001 From: xichengc Date: Mon, 27 Jan 2014 10:31:28 -0800 Subject: [PATCH] Update compass.sh Change-Id: I1e5e9e68e24b5eb8263f85746d2b5baac08eea2a --- compass/actions/cli.py | 2 ++ install/compass.sh | 29 ++++++++++++++++++++++++----- install/install.conf | 1 + 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/compass/actions/cli.py b/compass/actions/cli.py index ef17d30f..e93dc4b9 100644 --- a/compass/actions/cli.py +++ b/compass/actions/cli.py @@ -95,9 +95,11 @@ class BootCLI: print "====================" if successful is True: print "Compass Check completes. No problems found, all systems go" + sys.exit(0) else: print "Compass has ERRORS shown above. Please fix them before " \ "deploying!" + sys.exit(1) def run_refresh(self, action=None): ## TODO: replace refresh.sh with refresh.py diff --git a/install/compass.sh b/install/compass.sh index c1106d2a..36cac180 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -9,10 +9,27 @@ copygit2dir() repo=$2 if [ -d $destdir ];then echo "$destdir exists" + cd $destdir + git remote set-url origin $repo + git remote update + git reset --hard + git clean -x -f + git checkout master + git reset --hard remotes/origin/master + if [[ -n "$GERRIT_REFSPEC" ]];then + git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD + fi + git clean -x -f else mkdir -p $destdir + git clone $repo $destdir + if [[ -n "$GERRIT_REFSPEC" ]];then + # project=$(echo $repo|rev|cut -d '/' -f 1|rev) + cd $destdir + git fetch $repo $GERRIT_REFSPEC && git checkout FETCH_HEAD + fi fi - git clone $repo $destdir + cd $SCRIPT_DIR } copylocal2dir() { @@ -31,8 +48,10 @@ cd $SCRIPT_DIR ##SUBNET=${SUBNET:-$(ip address| grep "global $NIC" |cut -f 6 -d ' ')} WEB_HOME=${WEB_HOME:-'/tmp/web/'} ADAPTER_HOME=${ADAPTER_HOME:-'/tmp/adapter/'} -WEB_SOURCE=${WEB_SOURCE:-'https://github.com/stackforge/compass-web'} -ADAPTER_SOURCE=${ADAPTER_SOURCE:-'https://github.com/stackforge/compass-adapters'} +##WEB_SOURCE=${WEB_SOURCE:-'https://github.com/stackforge/compass-web'} +WEB_SOURCE=${WEB_SOURCE:-$PROJECT_NAME'/stackforge/compass-web'} +# ADAPTER_SOURCE=${ADAPTER_SOURCE:-'https://github.com/stackforge/compass-adapters'} +ADAPTER_SOURCE=${ADAPTER_SOURCE:-$PROJECT_NAME'/stackforge/compass-adapters'} if [ "$source" != "local" ]; then copygit2dir $WEB_HOME $WEB_SOURCE copygit2dir $ADAPTER_HOME $ADAPTER_SOURCE @@ -42,9 +61,9 @@ else fi # download dependences -wget http://github.com/downloads/bitovi/javascriptmvc/$JS_MVC.zip +wget -N http://github.com/downloads/bitovi/javascriptmvc/$JS_MVC.zip sudo yum install -y unzip -sudo unzip $JS_MVC +sudo unzip -o $JS_MVC sudo \cp -rf $JS_MVC/. $WEB_HOME/public/ # update squid conf diff --git a/install/install.conf b/install/install.conf index ffb9105c..11663a5b 100755 --- a/install/install.conf +++ b/install/install.conf @@ -20,6 +20,7 @@ export OPTION_ROUTER= IP_RANGE= # TFTP server's IP address(Default: Management Interface/eth0 IP) export NEXTSERVER= + # the domains covered by nameserver export NAMESERVER_DOMAINS=