Wire up first stab at automation

This commit is contained in:
decentral1se 2021-07-13 11:34:51 +02:00
commit a5ffbaf902
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
4 changed files with 70 additions and 0 deletions

24
.drone.yml Normal file
View File

@ -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

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# pubscripts
Publishing automation for [beta.lumbung.space](https://beta.lumbung.space).

41
generate.sh Executable file
View File

@ -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

2
makefile Normal file
View File

@ -0,0 +1,2 @@
test:
@docker run -v $$(pwd):/work -it python:alpine /work/generate.sh