datatracker/dev/INSTALL
2022-04-29 09:45:41 -05:00

102 lines
3.2 KiB
Plaintext

==============================================================================
IETF Datatracker
==============================================================================
------------------------------------------------------------------------------
Installation Instructions
------------------------------------------------------------------------------
General Instructions for Deployment of a New Release
====================================================
1. Make a directory to hold the new release::
sudo su - -s /bin/bash wwwrun
mkdir /a/www/ietf-datatracker/${releasenumber}
cd /a/www/ietf-datatracker/${releasenumber}
2. Fetch the release tarball from github
(see https://github.com/ietf-tools/datatracker/releases)::
wget https://github.com/ietf-tools/datatracker/archive/refs/tags/${releasenumber}.tar.gz
tar xzvf ${releasenumber}.tar.gz
3. Copy ietf/settings_local.py from previous release::
cp ../web/ietf/settings_local.py ietf/
4. Setup a new virtual environment and install requirements::
python3.9 -mvenv env
source env/bin/activate
pip install --upgrade setuptools
pip install -r requirements.txt
5. Run system checks (which patches the just installed modules)::
ietf/manage.py check
6. Move static files into place for CDN (/a/www/www6s/lib/dt):
ietf/manage.py collectstatic --noinput --ignore=bower.json --ignore='README.*' --ignore=rev | grep -v "Found another file with the destination path"
7. Run migrations:
ietf/manage.py migrate
8. Back out one directory level, then re-point the 'web' symlink::
cd ..
rm ./web; ln -s ${releasenumber} web
9. Reload both apache and the datatracker service ::
exit # or CTRL-D, back to root level shell
systemctl restart apache2 datatracker.service
10. Verify operation:
http://datatracker.ietf.org/
11. If install failed, revert web symlink and repeat the restart in step 9.
Patching a Production Release
=============================
Sometimes it can prove necessary to patch an existing release.
The following process should be used:
1. Code and test the patch on an copy of the release with any
previously applied patches put in place.
2. Produce a patch file, named with date and subject::
$ git diff > 2013-03-25-ballot-calculation.patch
3. Move the patch file to the production server, and place it in
'/a/www/ietf-datatracker/patches/'
4. Make a recursive copy of the production code to a new directory, named with a patch number.
/a/www/ietf-datatracker $ rsync -a web/ ${releasenumber}.p1/
5. Apply the patch::
/a/www/ietf-datatracker $ cd ${releasenumber}.p1/
/a/www/ietf-datatracker/${releasnumber}.p1 $ patch -p1 \
< ../patches/2013-03-25-ballot-calculation.patch
This must not produce any messages about failing to apply any chunks;
if it does, go back to 1. and figure out why.
6. Edit ``.../ietf/__init__.py`` in the new patched release to indicate the patch
version in the ``__patch__`` string.
7. Change the 'web' symlink, reload etc. as described in
`General Instructions for Deployment of a New Release`_.