feat: add content generation

See ruangrupa/living-room#17.
This commit is contained in:
cellarspoon 2022-01-05 12:53:04 +01:00
parent ce3e864008
commit d92732109f
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
4 changed files with 65 additions and 1 deletions

View File

@ -2,7 +2,7 @@
kind: pipeline
name: continuous deployment
steps:
- name: build image
- name: push hugo image
image: plugins/docker
settings:
username:
@ -13,6 +13,17 @@ steps:
repo: decentral1se/beta.lumbung.space
tags: latest
- name: push scripts image
image: plugins/docker
settings:
username:
from_secret: docker_reg_username
password:
from_secret: docker_reg_passwd
dockerfile: Dockerfile.scripts
repo: decentral1se/beta.lumbung.space-scripts
tags: latest
- name: deploy stack
image: decentral1se/stack-ssh-deploy:latest
settings:
@ -20,6 +31,9 @@ steps:
host: lumbung.space
deploy_key:
from_secret: drone_ssh_lumbung.space
depends_on:
- push hugo image
- push scripts image
trigger:
branch:
- main

11
Dockerfile.scripts Normal file
View File

@ -0,0 +1,11 @@
FROM python:3.9.9-alpine
RUN apk add --no-cache git bash
WORKDIR /src/
RUN git clone https://git.autonomic.zone/ruangrupa/lumbunglib /src/
RUN pip install -U setuptools pip
RUN pip install .

View File

@ -33,6 +33,41 @@ services:
- "traefik.http.services.coop-cloud-site.loadbalancer.server.port=1313"
- "traefik.http.routers.coop-cloud-site.tls.certresolver=production"
peertube:
image: decentral1se/beta.lumbung.space-scripts:latest
volumes:
- content:/src/content
environment:
OUTPUT_DIR: /src/content/video
command: |
bash -c "
while true
do
echo 'generating peertube posts...'
lumbunglib-vid
echo 'going to sleep for 5 minutes...'
sleep 300
done
"
calendar:
image: decentral1se/beta.lumbung.space-scripts:latest
volumes:
- content:/src/content
environment:
OUTPUT_DIR: /src/content/video
CALENDAR_URL: "https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export"
command: |
bash -c "
while true
do
echo 'generating calendar posts...'
lumbunglib-cal
echo 'going to sleep for 5 minutes...'
sleep 300
done
"
volumes:
content:

View File

@ -13,4 +13,8 @@ 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 push decentral1se/beta.lumbung.space-scripts
.PHONY: serve gen push-hugo