chore: include demo backup script, make it flakey
This commit is contained in:
parent
a335f9cf41
commit
d4dbc172d2
|
|
@ -42,6 +42,8 @@ EXPOSE 1337/tcp
|
|||
|
||||
COPY config.yaml /config
|
||||
COPY var/entities/* /config/entities/
|
||||
COPY examples/backupScript.sh /opt/backupScript.sh
|
||||
RUN chmod 755 /opt/backupScript.sh
|
||||
VOLUME /config
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ EXPOSE 1337/tcp
|
|||
|
||||
COPY config.yaml /config
|
||||
COPY var/entities/* /config/entities/
|
||||
COPY examples/backupScript.sh /opt/backupScript.sh
|
||||
RUN chmod 755 /opt/backupScript.sh
|
||||
VOLUME /config
|
||||
|
||||
COPY OliveTin /usr/bin/OliveTin
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
Loading…
Reference in New Issue