datatracker/dev/INSTALL

103 lines
3.3 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/releases/download/${releasenumber}/release.tar.gz
tar xzvf release.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 -r requirements.txt
5. Move static files into place for CDN (/a/www/www6s/lib/dt):
ietf/manage.py collectstatic
6. Run system checks (which patches the just installed modules)::
ietf/manage.py check
7. Run migrations:
ietf/manage.py migrate
Take note if any migrations were executed.
8. Back out one directory level, then re-point the 'web' symlink::
cd ..
rm ./web; ln -s ${releasenumber} web
9. Reload the datatracker service (it is no longer necessary to restart apache) ::
exit # or CTRL-D, back to root level shell
systemctl restart datatracker
10. Verify operation:
http://datatracker.ietf.org/
11. If install failed and there were no migrations at step 7, revert web symlink and repeat the restart in step 9.
If there were migrations at step 7, they will need to be reversed before the restart at step 9. If it's not obvious
what to do to reverse the migrations, contact the dev team.
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`_.