Wrap askbot migration steps in code blocks

Wrap the migration commands for askbot in shell code blocks so that
the HTML formatting is more amenable to cutting and pasting.

Change-Id: I86e3c518daa875551d8a671d7775ad932391f420
This commit is contained in:
Jeremy Stanley
2015-03-18 14:17:49 +00:00
parent 91dd6a56e0
commit 5c5f3a5ea6

View File

@@ -129,12 +129,16 @@ Invoke management commands
The management cli tool is available under /srv/askbot-sites/slot0/config, so The management cli tool is available under /srv/askbot-sites/slot0/config, so
to invoke management commands you need to enter this directory first. to invoke management commands you need to enter this directory first.
.. code-block:: bash
$ cd /srv/askbot-sites/slot0/config $ cd /srv/askbot-sites/slot0/config
$ python manage.py <command> <args> $ python manage.py <command> <args>
Stop celeryd and apache, jetty services Stop celeryd and apache, jetty services
--------------------------------------- ---------------------------------------
.. code-block:: bash
$ sudo service askbot-celeryd stop $ sudo service askbot-celeryd stop
$ sudo service apache2 stop $ sudo service apache2 stop
$ sudo service jetty stop $ sudo service jetty stop
@@ -144,17 +148,23 @@ Restore database dump
Recreate an empty database: Recreate an empty database:
.. code-block:: bash
$ sudo su - postgres -c 'dropdb askbotdb' $ sudo su - postgres -c 'dropdb askbotdb'
$ sudo su - postgres -c 'createdb askbotdb --owner=ask' $ sudo su - postgres -c 'createdb askbotdb --owner=ask'
Restore from backup: Restore from backup:
.. code-block:: bash
$ psql -d askbotdb -h localhost -U ask -W -f /path/to/last-dump.sql $ psql -d askbotdb -h localhost -U ask -W -f /path/to/last-dump.sql
`Notice` you will be prompted for the ask_db_password from hiera. `Notice` you will be prompted for the ask_db_password from hiera.
Sync db and migrate: Sync db and migrate:
.. code-block:: bash
$ cd /srv/askbot-sites/slot0/config $ cd /srv/askbot-sites/slot0/config
$ sudo python manage.py syncdb $ sudo python manage.py syncdb
$ sudo python manage.py migrate $ sudo python manage.py migrate
@@ -164,12 +174,16 @@ Sync db and migrate:
Start celeryd Start celeryd
------------- -------------
.. code-block:: bash
$ sudo service askbot-celeryd start $ sudo service askbot-celeryd start
$ sudo service apache2 start $ sudo service apache2 start
Rebuild solr indexes Rebuild solr indexes
-------------------- --------------------
.. code-block:: bash
$ sudo service jetty start $ sudo service jetty start
$ cd /srv/askbot-sites/slot0/config $ cd /srv/askbot-sites/slot0/config
$ sudo python manage.py askbot_rebuild_index -l en $ sudo python manage.py askbot_rebuild_index -l en
@@ -177,6 +191,8 @@ Rebuild solr indexes
Test the solr deployment, query string "sahara": Test the solr deployment, query string "sahara":
.. code-block:: bash
$ curl "http://127.0.0.1:8983/solr/core-en/select/?fq=django_ct%3A%28askbot.thread%29&rows=10&q=%28sahara%29&start=0&wt=json&fl=%2A+score" $ curl "http://127.0.0.1:8983/solr/core-en/select/?fq=django_ct%3A%28askbot.thread%29&rows=10&q=%28sahara%29&start=0&wt=json&fl=%2A+score"
`Notice` this query must return a non-empty resultset. `Notice` this query must return a non-empty resultset.
@@ -184,6 +200,8 @@ Test the solr deployment, query string "sahara":
Restart celeryd Restart celeryd
--------------- ---------------
.. code-block:: bash
$ sudo service askbot-celeryd restart $ sudo service askbot-celeryd restart
$ sudo service apache2 restart $ sudo service apache2 restart
@@ -194,6 +212,8 @@ Static files must be extracted into /srv/askbot-sites/slot0/upfiles directory.
It mostly holds profile pictures, and site logo, so if pictures not showing up It mostly holds profile pictures, and site logo, so if pictures not showing up
in the site those files are missing, or have a wrong file permission. in the site those files are missing, or have a wrong file permission.
.. code-block:: bash
$ cd /srv/askbot-sites/slot0 $ cd /srv/askbot-sites/slot0
$ sudo rm -rf upfiles $ sudo rm -rf upfiles
$ sudo tar xf /path/to/last-upfiles.tar --strip-components=2 $ sudo tar xf /path/to/last-upfiles.tar --strip-components=2