| |
@@ -77,7 +77,62 @@
|
| |
|
| |
$ PYTHONPATH=.:/path/to/pagure/checkout pytest pagure_distgit_tests/
|
| |
|
| |
- You can use our requirements-testing.txt to install testing dependencies with pip:
|
| |
+ You can use our requirements-testing.txt to install testing dependencies with pip::
|
| |
+
|
| |
$ pip install -r /path/to/pagure/checkout/requirements.txt
|
| |
$ pip install -r /path/to/pagure/checkout/requirements-testing.txt
|
| |
$ pip install -r requirements-testing.txt
|
| |
+
|
| |
+ Setting up testing env
|
| |
+ ======================
|
| |
+
|
| |
+ The dist-git needs pagure to run. This guide will use the existing pagure vagrant setup with
|
| |
+ few modifications. First you need to clone pagure::
|
| |
+
|
| |
+ $ git clone https://pagure.io/pagure.git
|
| |
+ $ cd pagure
|
| |
+
|
| |
+ Next step is to copy `Vagrantfile.example` as `Vagrantfile` to git root folder::
|
| |
+
|
| |
+ $ cp dev/Vagrantfile.example Vagrantfile
|
| |
+
|
| |
+ Add mount point for the dist-git repository. You need to add the following to
|
| |
+ `Vagrantfile`::
|
| |
+
|
| |
+ config.vm.synced_folder "/path/to/pagure-dist-git", "/srv/pagure-dist-git", type: "sshfs"
|
| |
+
|
| |
+ Create the vagrant machine and ssh into it::
|
| |
+
|
| |
+ $ vagrant up && vagrant ssh
|
| |
+
|
| |
+ In the vagrant we need to do a few more steps. First add dist-git specific tables and
|
| |
+ some test data::
|
| |
+
|
| |
+ $ cd /srv/pagure-dist-git/
|
| |
+ $ sudo -u git python createdb.py -c /etc/pagure/pagure.cfg
|
| |
+ $ cd /srv/pagure
|
| |
+ $ sudo -u git PAGURE_CONFIG="/etc/pagure/pagure.cfg" python dev-data.py -a
|
| |
+
|
| |
+ Add theme to `/etc/pagure/pagure.cfg`::
|
| |
+
|
| |
+ THEME = 'srcfpo'
|
| |
+
|
| |
+ Update `/etc/systemd/system/pagure.service` with env variables::
|
| |
+
|
| |
+ Environment="PAGURE_PLUGINS_CONFIG=/srv/pagure-dist-git/pagure_distgit_config"
|
| |
+ Environment="PYTHONPATH=/srv/pagure-dist-git"
|
| |
+
|
| |
+ Stop the running pagure instance::
|
| |
+
|
| |
+ $ pstop
|
| |
+
|
| |
+ Reload systemd daemons::
|
| |
+
|
| |
+ $ sudo systemctl daemon-reload
|
| |
+
|
| |
+ Start the pagure instance again::
|
| |
+
|
| |
+ $ pstart
|
| |
+
|
| |
+ Now you should have running instance of pagure with dist-git on `http://localhost:5000`.
|
| |
+ Nice hacking! :-)
|
| |
Signed-off-by: Michal Konečný mkonecny@redhat.com