#!/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@git.wit.com:wit/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 'https://github.com/coredns/unbound' 'cloud/coredns-unbound' gitclonefail 'https://github.com/miekg/unbound.git' 'cloud/coredns-miekg-unbound' 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/liveblock.git' 'crypto/bitcoin-liveblock' gitclonefail 'git@github.com:witstartup/witchain.git' 'crypto/witchain' 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 'https://github.com/nicehash/sgminer.git' 'crypto/mining-code/nicehash-sgminer' gitclonefail 'git@github.com:witstartup/VirtexEval.git' 'fpga/VirtexEval' gitclonefail 'https://github.com/ReconfigureIO/examples' 'fpga/ReconfigureIO-examples' 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' witgitclone 'git/website/jcarr/1200-hugo-xmin' 'website/jcarr/1200-hugo-xmin' witgitclone 'git/website/jcarr/1201-hugo-ananke' 'website/jcarr/1201-hugo-ananke' witgitclone 'git/website/jcarr/1202-hugo-jefftest' 'website/jcarr/1202-hugo-jefftest' witgitclone 'git/website/jcarr/3000-simple-trello' 'website/jcarr/3000-simple-trello' witgitclone 'git/website/jcarr/8443-webrtc-example' 'website/jcarr/8443-webrtc-example' gitclonefail 'https://github.com/anoek/webrtc-group-chat-example.git' 'website/jcarr/webrtc-group-chat-example' exit 0