1

Is there any way by which I can run syncdb from my terminal? I don't know why my action_hooks/deploy script is not running. When I open my openshift database it show no table created.

source ${OPENSHIFT_HOMEDIR}python-2.6/virtenv/bin/activate
export PYTHON_EGG_CACHE=${OPENSHIFT_HOME_DIR}python-2.6/virtenv/lib/python-2.6/site-packages
echo "Executing 'python ${OPENSHIFT_REPO_DIRwsgi/my/manage.py syncdb --noinput'"
python "$OPENSHIFT_REPO_DIR"my/manage.py syncdb --noinput
echo "Executing 'python ${OPENSHIFT_REPO_DIR}wsgi/my/manage.py collectstatic --noinput -v0'"
python "$OPENSHIFT_REPO_DIR"my/manage.py collectstatic --noinput -v0

git repo at https://github.com/sarvesh-onlyme/ninja/tree/master/openshift/django

Sarvesh Gupta
  • 59
  • 1
  • 9

2 Answers2

2

How about:

source $OPENSHIFT_HOMEDIR/python-2.6/virtenv/bin/activate
cd $OPENSHIFT_REPO_DIR/wsgi/$OPENSHIFT_APP_NAME
python manage.py syncdb --noinput

Please make sure to do something similar if your application type is python 2.7 based.

let me know if it does not work.

Sumana Mehta
  • 2,663
  • 1
  • 14
  • 10
  • There were some changes to action hooks, I hope you are following the latest set of instructions from here: https://github.com/openshift/origin-server/blob/master/node/README.writing_applications.md#action-hooks. Also make sure you have execute permissions on the deploy script in your local git repo. For – Sumana Mehta Jun 19 '13 at 19:29
  • mam, i'm new to this openshift thing, can u suggest me what's wrong in my openshift project, i've make a repo at https://github.com/sarvesh-onlyme/ninja/tree/master/openshift/django . could be pls suggest what wrong in there – Sarvesh Gupta Jun 21 '13 at 15:40
0

check logs (rhc tail app_name). Try to login to OpenShift app through ssh (rhc ssh app_name) and try to run deploy script manually (cd app-root/runtime/repo/.openshift/action_hooks; ./deploy). Do you see any errors?

Post your logs/errors here. I will update my answer afterwards.

//lol, sorry, I did not notice it's two year old question.

Lucas03
  • 2,267
  • 2
  • 32
  • 60