More robust gitea dump override
This commit is contained in:
@@ -54,9 +54,19 @@
|
||||
WorkingDirectory = cfg.dump.backupDir;
|
||||
};
|
||||
|
||||
# gitea dump does not allow overriding files. Instead dump to stdout with -
|
||||
script = ''
|
||||
${exe} dump --type ${cfg.dump.type} --file - >"gitea-dump-$(date +%a).${cfg.dump.type}"
|
||||
output="gitea-dump-$(date +%a).${cfg.dump.type}"
|
||||
|
||||
if ${exe} dump --type ${cfg.dump.type} --file - >"temp.zip" ; then
|
||||
if [ -s "temp.zip" ] ; then
|
||||
mv temp.zip "$output"
|
||||
echo "INFO: Backup saved at $output"
|
||||
exit 0
|
||||
fi
|
||||
echo "ERROR: dump command exited correctly, but temp.zip is empty"
|
||||
fi
|
||||
echo "ERROR: dump failed"
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user