commit a5ffbaf902810faa28372e3db5ca7205d53dab07 Author: decentral1se Date: Tue Jul 13 11:34:51 2021 +0200 Wire up first stab at automation diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..81afb7c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,24 @@ +--- +kind: pipeline +name: publish to beta.lumbung.space +steps: + - name: generate new contents + image: python:alpine + environment: + OUTPUT_DIR: /drone/src/output + CALENDAR_URL: "https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export" + commands: + - ./generate.sh + + - name: publish new contents + image: 3wordchant/docker-cp-deploy:latest + settings: + host: lumbung.space + service: beta_lumbung_space_app + source: /drone/src/output + dest: /src/content + deploy_key: + from_secret: drone_ssh_lumbung.space +trigger: + branch: + - main diff --git a/README.md b/README.md new file mode 100644 index 0000000..f9a156b --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pubscripts + +Publishing automation for [beta.lumbung.space](https://beta.lumbung.space). diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..15a6aaf --- /dev/null +++ b/generate.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +mkdir -p output + +echo "Using $OUTPUT_DIR as output directory..." +echo "Using $CALENDAR_URL as Nextcloud calendar URL..." + +clone_repos() { + if ! type git > /dev/null 2>&1; then + apk add --no-cache git + fi + git clone https://git.autonomic.zone/ruangrupa/lumbung-video-prototype + git clone https://git.autonomic.zone/ruangrupa/lumbung-calendar-prototype +} + +install_deps() { + cd lumbung-video-prototype + pip install -r requirements.txt + cd - + + cd lumbung-calendar-prototype + pip install -r requirements.txt + cd - +} + +gen_vid() { + cd lumbung-video-prototype + python video-feed.py + cd - +} + +gen_cal() { + cd lumbung-calendar-prototype + python event-feed.py + cd - +} + +clone_repos +install_deps +gen_vid +gen_cal diff --git a/makefile b/makefile new file mode 100644 index 0000000..dc9dcdd --- /dev/null +++ b/makefile @@ -0,0 +1,2 @@ +test: + @docker run -v $$(pwd):/work -it python:alpine /work/generate.sh