Jenkins fighting with Django over permissions

I’ve got a Jenkins/Nginx server running. But I get the error from Django:

 attempt to write a readonly database

So I solved this problem by changing the ownership of the project folder to the default user:

chown -R joren . 

Now Django is working properly, but Jenkins doesn’t seem to agree because now it is unable to build due to permission errors.

How do I get both sides to work together properly?

Edit:

Nginx is runnings as www-data

Jenkins is running as jenkins

Edit2:

The job builds the directory from a git repository, activates the virtualenv, tests the django apps (and other django-specific operations) and then restarts the server. The src subdirectory of the directory to which it is built, is the root of the nginx server.

The workaround:

Switch sqlite3 for postgresql3. Still looking for a proper solution though.

Answer

Make a group for jekins and django, then give the group write permissions.

Attribution
Source : Link , Question Author : Community , Answer Author : Steven Jackson

Leave a Comment