feat: add content generation
All checks were successful
continuous-integration/drone/push Build is passing

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 kind: pipeline
name: continuous deployment name: continuous deployment
steps: steps:
- name: build image - name: push hugo image
image: plugins/docker image: plugins/docker
settings: settings:
username: username:
@ -13,6 +13,17 @@ steps:
repo: decentral1se/beta.lumbung.space repo: decentral1se/beta.lumbung.space
tags: latest 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 - name: deploy stack
image: decentral1se/stack-ssh-deploy:latest image: decentral1se/stack-ssh-deploy:latest
settings: settings:
@ -20,6 +31,9 @@ steps:
host: lumbung.space host: lumbung.space
deploy_key: deploy_key:
from_secret: drone_ssh_lumbung.space from_secret: drone_ssh_lumbung.space
depends_on:
- push hugo image
- push scripts image
trigger: trigger:
branch: branch:
- main - 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.services.coop-cloud-site.loadbalancer.server.port=1313"
- "traefik.http.routers.coop-cloud-site.tls.certresolver=production" - "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: volumes:
content: content:

View File

@ -13,4 +13,8 @@ push-hugo:
@docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \ @docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \
docker push decentral1se/beta.lumbung.space 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 .PHONY: serve gen push-hugo