Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automated django receive hook on server: respond to collectstatic with "yes"

Tags:

git

django

hook

I'm using a Github post-recieve hook to run a bash file that pulls both my repos.

#!/bin/sh
cd ~/public_html/repo_static
env -i /usr/bin/git pull origin master
cd ~/django-code/repo_django
env -i /usr/bin/git pull origin master

I also want to collectstatic on the django repo. How do I automate the "yes" response to that?

I can't use Fabric because unfortunately the team chose to work with Python 2.4 for the time being. Is there a way to automate collectstatic without Fabric?

like image 324
Artur Sapek Avatar asked Jan 02 '12 21:01

Artur Sapek


2 Answers

python manage.py collectstatic --noinput
like image 103
Tommaso Barbugli Avatar answered Nov 05 '22 12:11

Tommaso Barbugli


If you'd like to specify the default answer, you could also just pipe it into the command:

$ echo yes | python manage.py collectstatic

or

$ echo no | python manage.py collectstatic
like image 14
Kris Avatar answered Nov 05 '22 13:11

Kris