Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Upgrade to v1.0.0

E. M. Bray edited this page May 11, 2018 · 2 revisions

Upgrade/migration notes for v1.0.0

  • Make a fresh clone of the sage_trac_plugin git repository and cd into it:

    $ git clone https://github.com/sagemath/sage_trac_plugin.git && cd sage_trac_plugin
    
  • Check out the v1.0.0 tag:

    $ git checkout v1.0.0
    
  • Put the Trac site in "maintenance" mode be creating the special file .down:

    $ sudo touch /srv/trac/sage_trac/htdocs/.down
    

    It should be fine to leave git access up. Alternatively, you can write the following contents to .down: Define allowed_ip <IP_ADDRESS> and provide your external IP address. This way the site will still be accessible to you while performing maintenance.

  • Install the new version of the plugin (without upgrading dependencies for now):

    $ sudo pip install --no-deps --upgrade .
    
  • I noticed for some reason the server has some old .egg-info directories for old versions of the plug-in lying around, so clean those up too:

    $ sudo rm -rf /usr/local/lib/python2.7/dist-packages/sage_trac-0.3.*.egg-info
    
  • Delete the custom ticket box template--this is provided directly by the plugin now:

    $ sudo rm -f /srv/trac/sage_trac/templates/ticket_box.html
    
  • The new version has a couple new settings that must be added to the trac.ini. So with your preferred editor, open /srv/trac/sage_trac/conf/trac.ini. First find the [components] section of the configuration, and add to it:

    sage_trac.ticket_box.ticketbox = enabled
    

    Then find the [sage_trac] section and add the option:

    patchbot_url = https://patchbot.sagemath.org
    
  • One issue to be aware of--due to a minor annoyance of the Sage plugin, it tries update the clone of the gitolite-admin repository even when running trac-admin commands (this should be fixed later). This means that the user running the commands has to have an SSH key with permissions to pull from the gitolite-admin repo. There are a few options here: You can add the root user's public key to the gitolite-admin repository and give it read access to the repository. Or, since the www-data user already (by necessity) has R/W access to the repository, you can run the following commands as the www-data user. For now we'll prefer the latter. First, it's necessary to become root:

    $ sudo su
    
  • Now perform the database upgrade as the www-data user:

    # sudo -u www-data -H trac-admin /srv/trac/sage_trac upgrade
    
  • Get back out of the root sub-shell:

    # exit
    
  • Restart the web server, and then take it out of maintenance mode:

    $ sudo service apache2 restart
    $ sudo rm /srv/trac/sage_trac/htdocs/.down
    
Clone this wiki locally