oldrepo/clone-witcom.sh

128 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
ARGV1=$1
BASEPATH=`pwd`
cd $BASEPATH
# Check to see if the directory already exists and has a working .git directory
checkforgit()
{
# log_action_end_msg "$1" ${2:+"$2"}
path=$1
if [ -d $path ]; then
echo $path already exists
if [ "$ARGV1" = update ] ; then
cd $path
git pull
git submodule update --init --recursive
cd $BASEPATH
fi
return 0
else
echo $path does not exist. need to git clone here
return -1
fi
}
gitclone()
{
# log_action_end_msg "$1" ${2:+"$2"}
src=$1
path=$2
if checkforgit $path ; then
return -1;
fi
git clone $src $path
result=$?
echo git clone returned $result
return $result
}
gitclonefail()
{
src=$1
path=$2
gitclone $src $path
# make the directory on machines that don't have permissions so these
# repositories are just ignored in the future
mkdir -p $path
}
gitupdate()
{
src=$1
path=$2
#echo path=$path
#echo src=$src
cd $path ; git update
}
witgitclone()
{
base=$1
path=$2
#echo base src=$base
#echo path=$path
if checkforgit $path ; then
return -1;
fi
src='ssh://root@ping.wit.com/var/lib/'$base
gitclone $src $path
if checkforgit $path ; then
return -1;
fi
src='git://ping.wit.com/'$base
gitclone $src $path
if checkforgit $path ; then
return -1;
fi
src='http://ping.wit.com/'$base
gitclone $src $path
# log_action_end_msg "$1" ${2:+"$2"}
exit 0
}
gitclonefail 'git@github.com:witstartup/resumes.git' 'corp/resumes'
gitclonefail 'git@github.com:witstartup/org-docs.git' 'corp/org-docs'
witgitclone 'git/cloud/witcoredns' 'cloud/witcoredns'
witgitclone 'git/cloud/jcarrbox' 'cloud/jcarrbox'
witgitclone 'git/cloud/bind9dnssec' 'cloud/bind9dnssec'
gitclonefail 'git@github.com:witstartup/debcore.git' 'cloud/debcore'
gitclonefail 'git@github.com:witstartup/gpupoller.git' 'cloud/gpupoller'
gitclonefail 'git@github.com:witstartup/AndroidApp.git' 'phone/AndroidApp'
gitclonefail 'git@github.com:witstartup/webrtc-example.git' 'phone/webrtc-example'
gitclonefail 'git@github.com:witstartup/group-chat.git' 'phone/group-chat'
gitclonefail 'git@github.com:witstartup/http-https-tunnel.git' 'phone/http-https-tunnel'
gitclonefail 'git@github.com:witstartup/webproxy.git' 'phone/webproxy'
gitclonefail 'git@github.com:witstartup/VirtexEval.git' 'crypto/VirtexEval'
gitclonefail 'git@github.com:witstartup/liveblock.git' 'crypto/bitcoin-liveblock'
witgitclone 'git/crypto/realtime-crypto-data' 'crypto/realtime-crypto-data'
witgitclone 'git/crypto/mining-binaries' 'crypto/mining-binaries'
gitclonefail 'https://github.com/ethereum-mining/ethminer.git' 'crypto/mining-code/ethminer'
gitclonefail 'https://github.com/ethereum/cpp-ethereum' 'crypto/mining-code/cpp-ethereum'
gitclonefail 'https://github.com/vthoang/cgminer.git' 'crypto/mining-code/cgminer-vthoang'
gitclonefail 'https://github.com/ckolivas/cgminer.git' 'crypto/mining-code/cgminer-ckolivas'
gitclonefail 'https://github.com/zcash/zcash.git' 'crypto/mining-code/zcash'
gitclonefail 'git@github.com:witstartup/www.wit.com.git' 'website/www.wit.com'
gitclonefail 'git@github.com:witstartup/db.wit.com.git' 'website/db.wit.com'
gitclonefail 'git@github.com:witstartup/witcoin.git' 'website/witcoin'
gitclonefail 'git@github.com:witstartup/webrtc-example.git' 'website/webrtc-example'
witgitclone 'git/website/ping.wit.com' 'website/ping.wit.com'
witgitclone 'git/website/jcarr/check.jcarr.wit.com' 'website/jcarr/check.jcarr.wit.com'
exit 0