39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: microblogpub-compile-css
|
|
namespace: microblogpub
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: css-compiler
|
|
image: python:3.11-slim
|
|
command: ["/bin/bash", "-c"]
|
|
args:
|
|
- |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends curl build-essential gcc libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev libxslt-dev gcc libjpeg-dev zlib1g-dev libwebp-dev make git
|
|
curl -sSL https://install.python-poetry.org | python3 -
|
|
export PATH="/root/.local/bin:$PATH"
|
|
cd /app
|
|
git clone https://git.sr.ht/~tsileo/microblog.pub .
|
|
poetry install
|
|
poetry run inv compile-scss
|
|
cp -r app/static/css/* /compiled-css/
|
|
volumeMounts:
|
|
- name: app-data
|
|
mountPath: /app/data
|
|
- name: compiled-css
|
|
mountPath: /compiled-css
|
|
workingDir: /app
|
|
volumes:
|
|
- name: app-data
|
|
persistentVolumeClaim:
|
|
claimName: microblogpub-data
|
|
- name: compiled-css
|
|
persistentVolumeClaim:
|
|
claimName: microblogpub-css
|
|
restartPolicy: Never
|
|
|