gitlab:build: Add option to export staging rootfs for debugging
Add support for exporting debug symbols from the staging directory by creating a compressed archive (rootfs-debug.tar.xz) when the CI_BUILD_EXPORT_STAGING_ROOTFS environment variable is set. This helps with debugging build issues by preserving the staging root directory contents for later analysis. The feature is: - Disabled by default to avoid unnecessary overhead - Activated only when explicitly requested via CI_BUILD_EXPORT_STAGING_ROOTFS - Archives the staging_dir/root-* directories into rootfs-debug.tar.xz To use this feature, simply set CI_BUILD_EXPORT_STAGING_ROOTFS when running the CI build job. References: PCF-1769 Signed-off-by: Mouna ALOUI <mouna.aloui@softathome.com>
This commit is contained in:
parent
67c7a70257
commit
99dcb0e625
@ -99,6 +99,14 @@
|
||||
exit 1
|
||||
" ERR
|
||||
- make -j $(nproc) 2>&1 | tee --append logs/build.log
|
||||
- >
|
||||
if [ -n "$CI_BUILD_EXPORT_STAGING_ROOTFS" ]; then
|
||||
root_dir=$(find $(pwd)/staging_dir -maxdepth 2 -type d -name root-*)
|
||||
tar cfJ "rootfs-debug.tar.xz" -C "$root_dir" .
|
||||
echo "Export of staging_dir/root-* completed in rootfs-debug.tar.xz"
|
||||
else
|
||||
echo "Skipping export of staging/root-* as `CI_BUILD_EXPORT_STAGING_ROOTFS` is not set."
|
||||
fi
|
||||
- rm .build_failed
|
||||
|
||||
after_script:
|
||||
@ -118,3 +126,4 @@
|
||||
- bin
|
||||
- logs
|
||||
- ./*packages-hash-issues.patch
|
||||
- rootfs-debug.tar.xz
|
||||
|
||||
Loading…
Reference in New Issue
Block a user