mirror of
https://github.com/auricom/home-cluster.git
synced 2025-10-01 16:05:55 +02:00
65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: music-transcode
|
|
namespace: default
|
|
spec:
|
|
schedule: "0 2 * * *"
|
|
suspend: true
|
|
concurrencyPolicy: "Forbid"
|
|
successfulJobsHistoryLimit: 3
|
|
failedJobsHistoryLimit: 5
|
|
jobTemplate:
|
|
spec:
|
|
backoffLimit: 3
|
|
ttlSecondsAfterFinished: 300
|
|
template:
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
restartPolicy: OnFailure
|
|
initContainers:
|
|
containers:
|
|
- name: transcode-incremental
|
|
image: ghcr.io/auricom/freac:1.1.6@sha256:19109ba643a4c772b7c95b6d311628b60a190010bc134c24d89767aee8df7ef6
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: TRANSCODE_INPUT_DIR
|
|
value: /mnt/music/
|
|
- name: TRANSCODE_OUTPUT_DIR
|
|
value: /mnt/music_transcoded/
|
|
- name: TRANSCODE_FREAC_BIN
|
|
value: /app/freaccmd
|
|
command:
|
|
- "/bin/bash"
|
|
- "-c"
|
|
- |
|
|
#!/bin/bash
|
|
|
|
HEALTHCHECKS=true
|
|
|
|
curl --location raw.githubusercontent.com/auricom/home-ops/main/scripts/transcode_music/transcode.bash --output /tmp/transcode.bash
|
|
chmod a+x /tmp/transcode.bash
|
|
curl --location raw.githubusercontent.com/auricom/home-ops/main/scripts/transcode_music/transcode_exclude.cfg --output /tmp/transcode_exclude.cfg
|
|
cd /tmp
|
|
./transcode.bash -c
|
|
test $? -ne 0 && HEALTHCHECKS=false
|
|
./transcode.bash -r
|
|
test $? -ne 0 && HEALTHCHECK=false
|
|
|
|
test FLAG && curl -m 10 --retry 5 http://healthchecks.default.svc.cluster.local.:/ping/${SECRET_HEALTHCHECKS_PING_KEY}/k3s-transcode-music
|
|
volumeMounts:
|
|
- name: music-transcoded
|
|
mountPath: /mnt/music_transcoded
|
|
- name: music
|
|
mountPath: /mnt/music
|
|
volumes:
|
|
- name: music-transcoded
|
|
nfs:
|
|
server: "${LOCAL_LAN_TRUENAS}"
|
|
path: /mnt/music_transcoded
|
|
- name: music
|
|
nfs:
|
|
server: "${LOCAL_LAN_TRUENAS}"
|
|
path: /mnt/storage/music
|