]> git.parisson.com Git - telemeta.git/commitdiff
fix backup/restore scripts, fix doc
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 28 Mar 2016 22:12:43 +0000 (00:12 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 28 Mar 2016 22:12:43 +0000 (00:12 +0200)
README.rst
scripts/sql/backup_db.sh
scripts/sql/restore_db.sh
telemeta/templates/telemeta/inc/module_searches.html

index 2a56455042b3f15d851faa8d69cce3aeb325e47e..45d2814e51b80d286d2ef89b639c0a6caeb4e38a 100644 (file)
@@ -112,29 +112,54 @@ password: demo
 Install
 =======
 
-Thanks to Docker, Telemeta is now fully available as a docker image ready to work. The docker based composition bundles some powerfull applications and modern frameworks out-of-the-box like: Python, Numpy, Gstreamer, Django, Celery, Haystack, ElasticSearch, MySQL, RabbitMQ, uWSGI, Nginx and many more...
+Thanks to Docker, Telemeta is now fully available as a docker composition ready to work. The docker based composition bundles some powerfull applications and modern frameworks out-of-the-box like: Python, Numpy, Gstreamer, Django, Celery, Haystack, ElasticSearch, MySQL, Redis, uWSGI, Nginx and many more.
 
-First install `Git <http://git-scm.com/downloads>`_, `Docker <https://docs.docker.com/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_, then run these commands in a terminal::
+On Linux, first install `Git <http://git-scm.com/downloads>`_, `Docker engine <https://docs.docker.com/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ and open a terminal.
+
+On MacOSX or Windows install the `Docker Toolbox <https://www.docker.com/products/docker-toolbox>`_ and open a Docker Quickstart Terminal.
+
+Then run these commands::
 
     git clone --recursive https://github.com/Parisson/Telemeta.git
     cd Telemeta
-    docker-compose up
+    docker-compose up db
+
+Press CTRL-C to exit (the last command is needed to init the database).
+
+Start
+=====
+
+For a production environment setup::
+
+     docker-compose up
 
-You can now browse http://localhost:8000
+Then browse the app at http://localhost:8000/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
 
+For a development environment setup::
 
-Restore / backup
+    docker-compose -f docker-compose.yml -f env/dev.yml up
+
+Then browse the app at http://localhost:9000/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
+
+To start the application in DEBUG mode::
+
+    docker-compose -f docker-compose.yml -f env/debug.yml up
+
+
+Backup / Restore
 ================
 
-To restore a backuped database, put your backup file in data/backup, then in another terminal::
+To backup the database in the data/backup/ folder, run this in **another** terminal (or a Docker Quickstart Terminal)::
+
+    docker-compose run db /srv/scripts/sql/backup_db.sh
 
-    docker-compose run db /srv/backup/restore_db.sh FILENAME
+To restore the last backuped database from the data/backup/ folder, run this in **another** terminal (or a Docker Quickstart Terminal)::
 
-where FILENAME is the backup filename (can be .sql or .sql.gz)
+    docker-compose run db /srv/scripts/sql/restore_db.sh
 
-To backup the database, just run in another terminal::
+If the app is broken after a restore script, restart the composition with::
 
-    docker-compose run db /srv/backup/backup_db.sh
+    docker-compose restart
 
 
 API / Documentation
@@ -205,7 +230,6 @@ Twitter:
 
 * https://twitter.com/telemeta
 * https://twitter.com/parisson_studio
-* https://twitter.com/yomguy
 
 
 License
index d18a057960a7ca930f26e94ff624b58525765f28..28bc08dbe37c2c3c60e835796e6b233a7e4bf3e2 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-PASSWORD=$1
 NOW=$(date +"%Y-%m-%d-%T")
 
-mysqldump -hdb -uroot -p$PASSWORD telemeta | gzip > /srv/backup/telemeta-$NOW.sql.gz
+mysqldump -hdb -uroot -p$MYSQL_ROOT_PASSWORD telemeta | gzip > /srv/backup/telemeta-$NOW.sql.gz
index be4cd5ba6eaade0c95de492552df26502e4c6205..a0689baa65cf09efd4f17790a40472de5b15c03b 100755 (executable)
@@ -1,13 +1,12 @@
 #!/bin/bash
 
-PASSWORD=$1
 DIR=/srv/backup/
 FILE=`ls -t $DIR/*.sql* | head -1`
 
 if [[ $FILE == *".gz" ]]; then
-    gunzip < $FILE | mysql -hdb -uroot -p$PASSWORD telemeta
+    gunzip < $FILE | mysql -hdb -uroot -p$MYSQL_ROOT_PASSWORD telemeta
 else
-    mysql -hdb -uroot -p$PASSWORD telemeta < $FILE
+    mysql -hdb -uroot -p$MYSQL_ROOT_PASSWORD telemeta < $FILE
 fi
 
 echo "backup restored : "$FILE
index 397724376baa451b11f99acdc7ab0b5091ed136b..b4c21145b6bbe08448c552bf827a219afae98752 100644 (file)
@@ -20,7 +20,6 @@
             {% elif s.search_key == 'advanced' %}
               {% with s.user_query|build_pattern_dict as queries %}
                 <a href="{% url "haystack_advance_search" %}?{{queries|build_query_string}}">
-
                 {% for k, v in queries.items %}
                  {% if v %}<li>{{ k }}: {{ v }}</li>{% endif %}
                 {% endfor %}