chore: include demo backup script, make it flakey

This commit is contained in:
jamesread 2026-06-17 17:27:56 +01:00
parent a335f9cf41
commit d4dbc172d2
3 changed files with 24 additions and 0 deletions

View File

@ -42,6 +42,8 @@ EXPOSE 1337/tcp
COPY config.yaml /config COPY config.yaml /config
COPY var/entities/* /config/entities/ COPY var/entities/* /config/entities/
COPY examples/backupScript.sh /opt/backupScript.sh
RUN chmod 755 /opt/backupScript.sh
VOLUME /config VOLUME /config
ARG TARGETPLATFORM ARG TARGETPLATFORM

View File

@ -35,6 +35,8 @@ EXPOSE 1337/tcp
COPY config.yaml /config COPY config.yaml /config
COPY var/entities/* /config/entities/ COPY var/entities/* /config/entities/
COPY examples/backupScript.sh /opt/backupScript.sh
RUN chmod 755 /opt/backupScript.sh
VOLUME /config VOLUME /config
COPY OliveTin /usr/bin/OliveTin COPY OliveTin /usr/bin/OliveTin

20
examples/backupScript.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
echo "Starting backup script"
# Demo behaviour: 50% finish in 9 seconds (within the 10s action timeout),
# 50% run for 15 seconds (typically times out).
if (( RANDOM % 2 == 0 )); then
maxFiles=9
echo "Demo: backup will finish in 9 seconds"
else
maxFiles=15
echo "Demo: backup will run for 15 seconds (may exceed the action timeout)"
fi
for fileIndex in $(seq 1 "$maxFiles"); do
echo "Backing up file: $fileIndex"
sleep 1
done
echo "All files backed up"