From 4de27027b98d6e5e1abd3913992f0e0c2d96ebc7 Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Tue, 17 Jan 2017 06:47:09 +0100 Subject: [PATCH 1/3] Add ability to run wannabag redis importer worker This adds the ability to run wallabag async import worker that interacts with a redis service. Signed-off-by: Jan Losinski --- root/entrypoint.sh | 5 +++++ root/etc/ansible/entrypoint.yml | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/root/entrypoint.sh b/root/entrypoint.sh index 55a4ea5..bcb59e8 100755 --- a/root/entrypoint.sh +++ b/root/entrypoint.sh @@ -4,5 +4,10 @@ if [ "$1" = "wallabag" ];then ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local exec s6-svscan /etc/s6/ fi +if [ "$1" = "import" ];then + ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local --skip-tags=firstrun + cd /var/www/wallabag/ + exec su -c "bin/console wallabag:import:redis-worker -e=prod $2 -vv" -s /bin/sh nobody +fi exec "$@" diff --git a/root/etc/ansible/entrypoint.yml b/root/etc/ansible/entrypoint.yml index 7f49f9d..0dda127 100644 --- a/root/etc/ansible/entrypoint.yml +++ b/root/etc/ansible/entrypoint.yml @@ -34,6 +34,8 @@ - /var/www/wallabag/data/assets - /var/www/wallabag/data/db notify: chown dir + tags: + - firstrun - name: write parameters.yml template: @@ -59,6 +61,8 @@ port="{{ database_port }}" when: (database_driver == 'pdo_mysql') or (database_driver == 'pdo_pgsql') + tags: + - firstrun - name: add mariadb db mysql_db: @@ -71,6 +75,8 @@ notify: run install when: (database_driver == 'pdo_mysql') and (populate_database == True) + tags: + - firstrun - name: add mariadb user mysql_user: @@ -86,6 +92,8 @@ when: (database_driver == 'pdo_mysql') and (database_user != 'root') and (populate_database == True) + tags: + - firstrun - name: postgresql db postgresql_db: @@ -98,6 +106,8 @@ notify: run install when: (database_driver == 'pdo_pgsql') and (populate_database == True) + tags: + - firstrun - name: add postgresql user postgresql_user: @@ -113,6 +123,8 @@ when: (database_driver == 'pdo_pgsql') and (database_user != 'postgres') and (populate_database == True) + tags: + - firstrun - name: remove cache file: From 65b2e2c7a99da2f510330e70689b7085c7e64c34 Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Tue, 17 Jan 2017 16:01:20 +0100 Subject: [PATCH 2/3] Add documentation for the redis worker service Signed-off-by: Jan Losinski --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 852038c..b838c4e 100644 --- a/README.md +++ b/README.md @@ -137,3 +137,11 @@ server { } ``` + +## Importer worker + +To run the [async redis importer worker](http://doc.wallabag.org/en/master/developer/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command: +``` +$ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...> wallabag/wallabag import +``` +Where type is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox, chrome. From 5203ab63b1b58d59bb2ae10303e56ef3ea20b866 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 23 Jan 2017 09:45:42 +0100 Subject: [PATCH 3/3] Rename importer to import --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b838c4e..d9ad103 100644 --- a/README.md +++ b/README.md @@ -138,10 +138,10 @@ server { } ``` -## Importer worker +## Import worker -To run the [async redis importer worker](http://doc.wallabag.org/en/master/developer/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command: +To run the [async redis import worker](http://doc.wallabag.org/en/master/developer/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command: ``` $ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...> wallabag/wallabag import ``` -Where type is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox, chrome. +Where `` is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox or chrome.