зеркало из https://github.com/mozilla/labs-vcap.git
Added VCAP_REPO_BRANCH optional argument to help install VCAP based on a point in time version of the repository
Change-Id: I2b81daee4d62bd940cbaca780bdb327d4b318b38
This commit is contained in:
Родитель
19dd169c76
Коммит
4445693257
|
@ -13,6 +13,7 @@ OPTIONS:
|
|||
-c deployment config
|
||||
-d cloudfoundry home
|
||||
-r cloud foundry repo
|
||||
-b cloud foundry repo branch/tag/SHA
|
||||
EOF
|
||||
}
|
||||
|
||||
|
@ -26,7 +27,7 @@ fi
|
|||
|
||||
APT_CONFIG="-o Acquire::http::No-Cache=True -o Acquire::BrokenProxy=true -o Acquire::Retries=3"
|
||||
|
||||
while getopts "had:p:c:r:" OPTION
|
||||
while getopts "had:p:c:r:b:" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
h)
|
||||
|
@ -45,6 +46,9 @@ do
|
|||
r)
|
||||
VCAP_REPO=$OPTARG
|
||||
;;
|
||||
b)
|
||||
VCAP_REPO_BRANCH=$OPTARG
|
||||
;;
|
||||
p)
|
||||
PROXY=$OPTARG
|
||||
export http_proxy=$PROXY
|
||||
|
@ -60,6 +64,10 @@ if [ -z "$VCAP_REPO" ]; then
|
|||
VCAP_REPO=https://github.com/cloudfoundry/vcap.git
|
||||
fi
|
||||
|
||||
if [ -z "$VCAP_REPO_BRANCH" ]; then
|
||||
VCAP_REPO_BRANCH=master
|
||||
fi
|
||||
|
||||
function run_cmd () {
|
||||
if [ -z "$PROXY" ]; then
|
||||
sudo $*
|
||||
|
@ -101,7 +109,7 @@ fi
|
|||
run_cmd apt-get $APT_CONFIG install -qym git-core
|
||||
[ -d $CLOUDFOUNDRY_HOME ] || mkdir $CLOUDFOUNDRY_HOME
|
||||
if [ ! -d $CLOUDFOUNDRY_HOME/vcap ]; then
|
||||
(cd $CLOUDFOUNDRY_HOME && git clone $VCAP_REPO && cd vcap && git submodule update --init)
|
||||
(cd $CLOUDFOUNDRY_HOME && git clone $VCAP_REPO && cd vcap && git submodule update --init && git checkout $VCAP_REPO_BRANCH)
|
||||
if [ $? != 0 ]; then
|
||||
echo "Unable to clone cloudfoundry repo."
|
||||
exit 1
|
||||
|
@ -126,4 +134,4 @@ if [ -n "$CONFIG_FILE" ]; then
|
|||
ARGS="$ARGS -c $CONFIG_FILE"
|
||||
fi
|
||||
|
||||
$CLOUDFOUNDRY_HOME/vcap/dev_setup/lib/chefsolo_launch.rb $ARGS
|
||||
$CLOUDFOUNDRY_HOME/vcap/dev_setup/lib/chefsolo_launch.rb $ARGS
|
Загрузка…
Ссылка в новой задаче