Created
November 6, 2011 17:31
-
-
Save starenka/1343207 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
PROJECTS_DIR="/www/outcomm/" | |
REPOS="ssh://chrootuser@esrv1.komunikacniagentura.cz//home/chrootuser/repos/" | |
VENVWRAPPER_SCRIPT="$(which virtualenvwrapper.sh)" | |
if [ -z "$1" ]; then echo "I need a repo name to setup the project, smeghead! (you can also specify alias as a second arg)"; exit 1; fi | |
if [ -z "$2" ]; then AS="$1"; else AS="$2"; fi | |
. $VENVWRAPPER_SCRIPT | |
TAR=$PROJECTS_DIR$AS | |
SP_DIR=$WORKON_HOME/$AS$(virtualenvwrapper_get_site_packages_dir) | |
RESET='\e[0m' | |
FAIL='\e[1;31m' # Red | |
OK='\e[1;32m' # Green | |
INFO='\e[1;33m' # Yellow | |
function nfo() { | |
echo -e "\n$2${INFO}[-] $1$RESET" | |
} | |
function ok() { | |
echo -e "\n\n$2${OK}[-] $1$RESET" | |
} | |
nfo "cloning repo $REPOS$1 to $TAR" | |
hg clone $REPOS$1 "$TAR" | |
nfo "making env at $WORKON_HOME/$AS" | |
mkvirtualenv "$AS" | |
cd "$TAR" | |
nfo "installing requirements" | |
pip install -r requirements.pip | |
nfo "installing test requirements" | |
pip install -r requirements_test.pip | |
for lib in "dol" "otherlibs"; do | |
nfo "cloning _outcomm_ library '$lib' to $WORKON_HOME/$AS/LIBS/$lib" | |
hg clone ${REPOS}LIBS/$lib $WORKON_HOME/$AS/LIBS/$lib | |
echo "export PYTHONPATH=\"$WORKON_HOME/$AS/LIBS/$lib:\$PYTHONPATH\"" >> $WORKON_HOME/$AS/bin/postactivate | |
#nfo "symlinking lib contents:" "\t" | |
#for f in $(ls -d $WORKON_HOME/$AS/LIBS/$lib/*); do echo -e "\t - $f"; ln -s $f $SP_DIR; done | |
done | |
nfo "cloning _outcomm_ staticlib to $WORKON_HOME/$AS/LIBS/staticlib" | |
hg clone ${REPOS}LIBS/staticlib $WORKON_HOME/$AS/LIBS/staticlib | |
ok "bye :p" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment