Patchwork: Difference between revisions
No edit summary |
(replace /etc/init.d with rc-service) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Patchwork | Patchwork is a widely used patch review system. | ||
This How-To aims to give a basis to setup Patchwork with PostgreSQL as backend. | This How-To aims to give a basis to setup Patchwork with PostgreSQL as backend. | ||
Line 10: | Line 10: | ||
== Initial package installation and setup PostgreSQL== | == Initial package installation and setup PostgreSQL== | ||
{{Cmd|apk add python py-django1.5 py-psycopg2 py-django-registration git postgresql}} | {{Cmd|apk add python py-django1.5 py-psycopg2 py-django-registration git postgresql}} | ||
{{Cmd| | {{Cmd|rc-service postgresql setup}} | ||
{{Cmd| | {{Cmd|rc-service postgresql start}} | ||
{{note|we are using py-django1.5 even if py-django (ver.1.7) is present in the repository. | |||
This is because Patchwork is not yet compatible with django 1.7. | This is because Patchwork is not yet compatible with django 1.7.}} | ||
Create a regular account called "pwuser": | Create a regular account called "pwuser": | ||
Line 30: | Line 30: | ||
== Patchwork Installation and Configuration == | == Patchwork Installation and Configuration == | ||
Login with "pwuser" and clone the patchwork's git repository: | Login with "pwuser" and clone the patchwork's git repository: | ||
{{Cmd|git clone git://ozlabs.org/home/jk/git/patchwork}} | {{Cmd|git clone <nowiki>git://ozlabs.org/home/jk/git/patchwork</nowiki>}} | ||
Create a local_settings.py starting from settings.py: | Create a local_settings.py starting from settings.py: | ||
Line 59: | Line 59: | ||
{{Cmd|python patchwork/apps/manage.py runserver 0.0.0.0:8000}} | {{Cmd|python patchwork/apps/manage.py runserver 0.0.0.0:8000}} | ||
Point your browser to http://$PATCHWORKS_SERVER_ADDRESS:8000 | Point your browser to <nowiki>http://$PATCHWORKS_SERVER_ADDRESS:8000</nowiki> | ||
Login with the username and password you set before. | Login with the username and password you set before. |
Latest revision as of 09:48, 17 November 2023
Patchwork is a widely used patch review system.
This How-To aims to give a basis to setup Patchwork with PostgreSQL as backend.
There are some aspects which can be improved that this how-to is not covering.
- Create an apk for patchwork with init script
- Describe how to setup Patchwork for one project
- Describe how to setup Patchwork with MariaDB
Initial package installation and setup PostgreSQL
apk add python py-django1.5 py-psycopg2 py-django-registration git postgresql
rc-service postgresql setup
rc-service postgresql start
Create a regular account called "pwuser":
adduser pwuser
As root:
su - postgresql createdb patchwork createuser pwuser createuser www-data createuser nobody
Last two users are hardcoded in one of the next sql script. That's why you need to create it.
Patchwork Installation and Configuration
Login with "pwuser" and clone the patchwork's git repository:
git clone git://ozlabs.org/home/jk/git/patchwork
Create a local_settings.py starting from settings.py:
cd patchwork/apps cp settings.py local_settings.py
Customize local_settings.py according with your need.
SECRET_KEY can be generated with the following python script:
import string, random chars = string.letters + string.digits + string.punctuation print repr("".join([random.choice(chars) for i in range(0,50)]))
Now, populate PostgreSQL with patchwork database.
As "pwuser":
python patchwork/apps/manage.py syncdb
At the end, the script will ask for patchwork's administrator username,email, and password.
Run another script for setting up the user's permissions:
psql -f patchwork/lib/sql/grant-all.postgres.sql patchwork
Now you can run the server:
python patchwork/apps/manage.py runserver 0.0.0.0:8000
Point your browser to http://$PATCHWORKS_SERVER_ADDRESS:8000
Login with the username and password you set before.
Enjoy.