-
-
Save PhilosopherRex/b3581ac3cceff3a14b41 to your computer and use it in GitHub Desktop.
Script for pulling, building and testing MaidSafe code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################## - USER DEFINITIONS | |
# if you use a proxy add it here otherwise leave blank | |
gitProxy= | |
# make sure there is a slash at the end of your installDir definition | |
installDir="/opt/safenet/src/" | |
# do you want to build and test? Leave blank if not | |
# show build and test output via "xterm" (windows), | |
# "roxterm" (tabs), or "logOnly" --> note case | |
buildTest="xterm" | |
######################################## - PROGRAM DEFINITIONS | |
safeRepo="https://github.com/maidsafe/" | |
libraries="crust routing maidsafe_client maidsafe_types maidsafe_vault maidsafe_nfs" | |
logDir="${installDir}logs/$(date +"%T")/" | |
######################################## - MAIN | |
if [ ${gitProxy} ]; then | |
http_proxy=${gitProxy} && HTTP_PROXY=$http_proxy | |
export http_proxy HTTP_PROXY | |
git config --global http.proxy $HTTP_PROXY | |
fi | |
[ ! -d ${installDir} ] && mkdir ${installDir} && cd ${installDir} | |
[ ! -d ${installDir}logs/ ] && mkdir ${installDir}logs/ | |
mkdir ${logDir} | |
for library in $libraries; do | |
subFolder=${installDir}${library} | |
if [ ! -d ${subFolder} ]; then | |
git clone ${safeRepo}${1} |& tee -a ${logDir}cloning.log | |
cd ${subFolder} | |
else | |
cd ${subFolder} | |
git pull origin master |& tee -a ${logDir}updating.log | |
fi | |
cargo clean | |
export RUST_TEST_THREADS=1 | |
[ ${buildTest} == "xterm" ] && xterm -hold -title ${library} -e "bash -c 'cargo build |& tee -a ${logDir}building-${library}.log; cargo test |& tee -a ${logDir}testing-${library}.log'" & | |
[ ${buildTest} == "roxterm" ] && roxterm --tab -f -n ${library} -e "bash -c 'cargo build |& tee -a ${logDir}building-${library}.log; cargo test |& tee -a ${logDir}testing-${library}.log'" & | |
[ ${buildTest} == "logOnly" ] && cargo build > ${logDir}building-${library}.log 2>&1; cargo test > ${logDir}testing-${library}.log 2>&1 & | |
done | |
exit 0 |
updated to add cargo clean and "export RUST_TEST_THREADS=1"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This version does logging + option to only pull and not to build and test.