refactored container image and gitea workflows
All checks were successful
/ build-docker-image (push) Successful in 1m2s
All checks were successful
/ build-docker-image (push) Successful in 1m2s
This commit is contained in:
9
docker/app/README.md
Normal file
9
docker/app/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# borg backup helper
|
||||
|
||||
for mode SCRIPT, file /app/backup-scripts/backup must be created.
|
||||
|
||||
- Docker Compose Configs Sections (check repo <https:///git.limbosolutions.com/kb/borg> readme file for more information);
|
||||
- binding mounts (Ex: ./backup-scripts:/app/backup-scripts);
|
||||
- kubernetes secrets, configSections or even volumes;
|
||||
|
||||
The file backup will be automatically executed if exists.
|
||||
33
docker/app/scripts/entrypoint.sh
Executable file
33
docker/app/scripts/entrypoint.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /app/scripts/loadenv
|
||||
|
||||
|
||||
case "$MODE" in
|
||||
|
||||
BORG)
|
||||
echo "executing borg cli"
|
||||
borg "${@:1}" # Forward all arguments except $0 to another CLI so first argument (the name of this scripts don't passthrough)"
|
||||
;;
|
||||
|
||||
SCRIPT)
|
||||
# check if file exists
|
||||
if [ ! -f /app/backup-scripts/backup ]; then
|
||||
cat /app/README.md
|
||||
exit 1
|
||||
fi
|
||||
echo "Executing: backup script with arguments: "\${@:1\"."
|
||||
cd /app/backup-scripts && bash backup "${@:1}"
|
||||
;;
|
||||
|
||||
SHELL)
|
||||
echo "Executing: bash -c \"${@:1}\"."
|
||||
bash -c "${@:1}"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown mode: $MODE."
|
||||
echo "Valid modes are: BORG, SCRIPT, SHELL"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -25,8 +25,7 @@ fi
|
||||
|
||||
export SSH_COMMAND="$SSH_COMMAND $SSH_CONNECTION"
|
||||
|
||||
|
||||
|
||||
: "${MODE:=BORG}" # Set default if MODE is unset to borg cli
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user