From 970f3f605da692d9d25b8978907d851067cd6280 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 20 Feb 2016 13:19:06 +0530 Subject: [PATCH] remove git repos from requirements.txt and add one place to set them up --- README | 8 ++------ ctl | 23 +++++++++++++++++++++++ requirements.txt | 2 -- update.py | 5 +++-- vm/pandora_install.sh | 6 ++---- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/README b/README index ab02dfb2..3a20a9fd 100644 --- a/README +++ b/README @@ -56,13 +56,9 @@ You have to use the same password here and in BROKER_URL in local_settings.py 1) Get code from git cd /srv/ - git clone --depth 1 https://git.0x260.org/pandora.git pandora + git clone https://git.0x260.org/pandora.git pandora cd pandora - virtualenv --system-site-packages . - ./bin/pip install -r requirements.txt - - cd static - git clone --depth 1 https://git.0x2620.org/oxjs.git + ./ctl init cd /srv chown -R pandora.pandora pandora diff --git a/ctl b/ctl index 4f90cf7e..8a1a4db0 100755 --- a/ctl +++ b/ctl @@ -6,6 +6,29 @@ if [ -z "$1" ]; then else action="$1" fi +if [ "$action" = "init" ]; then + cd "`dirname "$0"`" + BASE=`pwd` + virtualenv --system-site-packages . + if [ ! -d static/oxjs ]; then + git clone --depth 1 https://git.0x2620.org/oxjs.git static/oxjs + fi + mkdir -p src + if [ ! -d src/oxtimelines ]; then + git clone --depth 1 https://git.0x2620.org/oxtimelines.git src/oxtimelines + fi + for package in oxtimelines python-ox; do + cd ${BASE} + if [ ! -d src/${package} ]; then + git clone --depth 1 https://git.0x2620.org/${package}.git src/${package} + fi + cd ${BASE}/src/${package} + ${BASE}/bin/python setup.py develop + done + cd ${BASE} + ./bin/pip install -r requirements.txt + exit 0 +fi if [ `whoami` != 'root' ]; then echo you have to be root or run $0 with sudo exit 1 diff --git a/requirements.txt b/requirements.txt index ab740f15..f643a72a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,4 @@ Django==1.9.2 --e git+https://git.0x2620.org/python-ox.git#egg=python-ox --e git+https://git.0x2620.org/oxtimelines.git#egg=oxtimelines simplejson chardet celery==3.1.20 diff --git a/update.py b/update.py index aedd93d5..9169a265 100755 --- a/update.py +++ b/update.py @@ -211,10 +211,11 @@ if __name__ == "__main__": pandora_new_revno = revno else: os.chdir(os.path.dirname(path)) - cmd = ['git', 'clone', '--depth', '1', repos[repo]['url']] - run(*cmd) if 'revision' in repos[repo]: + run('git', 'clone', repos[repo]['url']) run_git(path, 'checkout', repos[repo]['commit']) + else: + run('git', 'clone', '--depth', '1', repos[repo]['url']) setup = os.path.join(base, repos[repo]['path'], 'setup.py') if repo in ('python-ox', 'oxtimelines') and os.path.exists(setup): os.chdir(os.path.dirname(setup)) diff --git a/vm/pandora_install.sh b/vm/pandora_install.sh index bc2b48df..aeb0b85b 100755 --- a/vm/pandora_install.sh +++ b/vm/pandora_install.sh @@ -85,11 +85,9 @@ rabbitmqctl add_vhost /pandora rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*" #pandora -git clone --depth 1 https://git.0x2620.org/pandora.git /srv/pandora -git clone --depth 1 https://git.0x2620.org/oxjs.git /srv/pandora/static/oxjs -virtualenv --system-site-packages /srv/pandora +git clone https://git.0x2620.org/pandora.git /srv/pandora cd /srv/pandora -./bin/pip install -r /srv/pandora/requirements.txt +./ctl init HOST=$(hostname -s) HOST_CONFIG="/srv/pandora/pandora/config.$HOST.jsonc"