chore: enhance debugging output in PR plugin generation scripts

- Added debug statements in `generate-pr-plugin.sh` to display the tarball path, backup directory, and list of files being processed, improving visibility during deployment.
- Updated `pr-plugin-build.yml` to include output of the file list and tarball contents, aiding in verification and troubleshooting during the build process.
This commit is contained in:
Eli Bosley
2025-09-10 12:30:03 -04:00
parent 8911531676
commit 6b1171a5fa
2 changed files with 19 additions and 4 deletions

View File

@@ -94,14 +94,19 @@ TARBALL="/boot/config/plugins/&name;/&tarball;"
MANIFEST="/boot/config/plugins/&name;/installed_files.txt"
echo "Starting file deployment..."
echo "Tarball: $TARBALL"
echo "Backup directory: $BACKUP_DIR"
# Clear manifest
> "$MANIFEST"
# Extract and get file list - use a temp file to avoid subshell issues
# Get file list first
tar -tzf "$TARBALL" > /tmp/plugin_files.txt
# Process each file
echo "Files in tarball:"
cat /tmp/plugin_files.txt
# Backup original files BEFORE extraction
while IFS= read -r file; do
# Skip directories
if [[ "$file" == */ ]]; then
@@ -112,13 +117,15 @@ while IFS= read -r file; do
# So the actual system path is /usr/local/emhttp/...
SYSTEM_FILE="/${file}"
# Check if file exists and backup
# Check if file exists and backup the ORIGINAL (before our changes)
echo "Processing file: $file -> $SYSTEM_FILE"
if [ -f "$SYSTEM_FILE" ]; then
BACKUP_FILE="$BACKUP_DIR/$(echo "$file" | tr '/' '_')"
echo "Backing up: $SYSTEM_FILE"
echo "Backing up original: $SYSTEM_FILE -> $BACKUP_FILE"
cp -p "$SYSTEM_FILE" "$BACKUP_FILE"
echo "$SYSTEM_FILE|$BACKUP_FILE" >> "$MANIFEST"
else
echo "New file: $SYSTEM_FILE"
echo "$SYSTEM_FILE|NEW" >> "$MANIFEST"
fi
done < /tmp/plugin_files.txt

View File

@@ -83,11 +83,19 @@ jobs:
# Create tarball - consistent filename for updates
cd build
echo "Creating tarball with contents:"
find usr/ -type f
tar -czf ../webgui-pr-${{ github.event.pull_request.number }}.tar.gz usr/
cd ..
# Generate file list for plugin
find build/usr/local/emhttp -type f | sed 's|^build||' > file_list.txt
echo "File list for plugin:"
cat file_list.txt
# Verify tarball contents
echo "Tarball contents:"
tar -tzf webgui-pr-${{ github.event.pull_request.number }}.tar.gz
- name: Configure AWS CLI for R2
if: steps.changed-files.outputs.has_changes == 'true'