Automating install, start, test and shutdown of django web application?

25 views
Skip to first unread message

morty

unread,
Apr 14, 2016, 7:50:02 AM4/14/16
to Django users
I have a django web application and would like to run headless tests using:

I am trying to implement an automatic/CI workflow like the one below:

1) clone latest version of my django web application
2) Install Django (e.g. in a python virtual environment)
3) Start django web server hosting my django web app
4) Run casper headless tests
5) Generate test report
6) Shutdown/remove django webserver/web application.

What are the recommended workflow for the above; automatically install, start, test and shutdown a django web application/web server?

I would like to avoid apache configuration if possible. 

For now I use the below script that covers bullet 1-2 above in a jenkins job:

  #!/bin/bash

  STAGING_DIR
="staging"
  rm
-Rf $STAGING_DIR
  mkdir $STAGING_DIR
  cd $STAGING_DIR

  git clone
[git-url] .
  virtualenv
--no-site-packages virtual_django
  source virtual_django
/bin/activate
  pip install django

 
#Hangs :-(
  python manage
.py runserver 0.0.0.0:8000

 
# ToDo: Run casperjs tests

 
# ToDo: Generate test report

 
# ToDo: Shutdown/remove django web server/web application



But it just hangs when it get to:

 python manage.py runserver 0.0.0.0:8000


it works fine from a plain bash terminal though.

I assume that others have automated the above workflow so could be great with some suggestions for this.
Reply all
Reply to author
Forward
0 new messages