From 595eee3bc07481371264547277c1559ffec98dca Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Wed, 5 Jan 2022 13:48:54 +0100 Subject: [PATCH] feat: include feed generation See https://git.autonomic.zone/ruangrupa/living-room/issues/20. --- README.md | 8 ++++++++ compose.yml | 25 +++++++++++++++++++++++++ feeds_list.txt | 1 + makefile | 5 +++-- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 feeds_list.txt diff --git a/README.md b/README.md index 083627c..f5d3fab 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ See the `sleep ...` statements in the [`compose.yml`](./compose.yml). - `docker service logs -f beta_lumbung_space_peertube` - `docker service logs -f beta_lumbung_space_calendar` +- `docker service logs -f beta_lumbung_space_feed` Where `beta_lumbung_space_` and you see the service name in the [`compose.yml`](./compose.yml). @@ -47,6 +48,9 @@ lumbunglib-cal export OUTPUT_DIR=content/video lumbunglib-vid + +export OUTPUT_DIR=content/feed +lumbunglib-feed # reads ./feeds_list.txt ``` Afterwards, you can automatically run it with `make gen`. @@ -62,3 +66,7 @@ Afterwards, you can automatically run it with `make gen`. (requires `lumbung.space` docker context) - `make deploy` + +### Deploy a new `feeds_list.txt` + +- Increment the `_v` (e.g. `v1` -> `v2`) in [`compose.yml`](./compose.yml) `configs` to avoid any deployment error diff --git a/compose.yml b/compose.yml index ae0e431..919d9c5 100644 --- a/compose.yml +++ b/compose.yml @@ -68,9 +68,34 @@ services: done " + feed: + image: decentral1se/beta.lumbung.space-scripts:latest + volumes: + - content:/src/content + configs: + - source: feeds_list + target: /src/feeds_list.txt + environment: + OUTPUT_DIR: /src/content/feed + command: | + bash -c " + while true + do + echo 'generating feed posts...' + lumbunglib-feed + echo 'going to sleep for 5 minutes...' + sleep 300 + done + " + volumes: content: networks: proxy: external: true + +configs: + feeds_list: + name: beta_lumbung_space_feeds_list_v1 + file: feeds_list.txt diff --git a/feeds_list.txt b/feeds_list.txt new file mode 100644 index 0000000..47cafed --- /dev/null +++ b/feeds_list.txt @@ -0,0 +1 @@ +https://artivismo.org/feed/ diff --git a/makefile b/makefile index b548575..389c749 100644 --- a/makefile +++ b/makefile @@ -7,14 +7,15 @@ gen: @CALENDAR_URL="https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export"; \ OUTPUT_DIR=content/calendar; \ lumbunglib-cal && \ - OUTPUT_DIR=content/video lumbunglib-vid + OUTPUT_DIR=content/video lumbunglib-vid && \ + OUTPUT_DIR=content/feed lumbunglib-feed push-hugo: @docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \ docker push decentral1se/beta.lumbung.space push-scripts: - @docker build -t decentral1se/beta.lumbung.space-scripts -f Dockerfile.scripts . && \ + @docker build --no-cache -t decentral1se/beta.lumbung.space-scripts -f Dockerfile.scripts . && \ docker push decentral1se/beta.lumbung.space-scripts deploy: