custom backup dir path can be specified from now on

This commit is contained in:
Mate Majoros 2026-01-13 14:37:30 +02:00
parent 4d7ec83b4e
commit 39949bb7db

View file

@ -17,7 +17,11 @@ on:
required: true required: true
type: string type: string
backup_timestamp: backup_timestamp:
description: 'Backup timestamp (e.g., 20260109_142920) - leave empty to use latest' description: '(Optional) Backup timestamp (e.g., 20260109_142920) - leave empty to use latest'
required: false
type: string
absolute_backup_dir_path:
description: '(Optional) Absolute path to the backup directory (the backup files contained in the directory should match the the following naming convention: <timestamp>-<site_name>-database.sql.gz, <timestamp>-<site_name>-files.tar, <timestamp>-<site_name>-private-files.tar.gz)'
required: false required: false
type: string type: string
@ -126,6 +130,9 @@ jobs:
cd ${{ env.DEPLOY_PATH }} cd ${{ env.DEPLOY_PATH }}
docker compose exec -T backend bash -c ' docker compose exec -T backend bash -c '
if [ -n \"${{ github.event.inputs.absolute_backup_dir_path }}\" ]; then
BACKUP_DIR=\"${{ github.event.inputs.absolute_backup_dir_path }}\"
else
# Check both possible archived locations # Check both possible archived locations
if [ -d /home/frappe/frappe-bench/archived/sites ]; then if [ -d /home/frappe/frappe-bench/archived/sites ]; then
ARCHIVED_BASE=/home/frappe/frappe-bench/archived/sites ARCHIVED_BASE=/home/frappe/frappe-bench/archived/sites
@ -165,6 +172,7 @@ jobs:
fi fi
BACKUP_DIR=\"\$ARCHIVED_SITE/private/backups\" BACKUP_DIR=\"\$ARCHIVED_SITE/private/backups\"
fi
if [ ! -d \"\$BACKUP_DIR\" ]; then if [ ! -d \"\$BACKUP_DIR\" ]; then
echo \"ERROR: Backup directory not found: \$BACKUP_DIR\" echo \"ERROR: Backup directory not found: \$BACKUP_DIR\"