Skip to content

Commit

Permalink
ci: Replace while loop with tail of multiple files
Browse files Browse the repository at this point in the history
Gives the exact same output:

```
docker run --rm -ti debian:11 bash -c '
  mkdir -p build/subdir1/ build/subdir2
  echo "subdir1 error" >build/subdir1/fail.log
  echo "subdir2 error" >build/subdir2/fail.log
  find build -type f -name "*.log" -exec tail -n +1 "{}" +
'
==> build/subdir1/fail.log <==
subdir1 error

==> build/subdir2/fail.log <==
subdir2 error
```

Signed-off-by: Manuel Mendez <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
mmlb authored and tlaurion committed May 2, 2024
1 parent 713eadc commit de3f4ec
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ commands:
name: Output build failing logs
command: |
if [[ -f ./tmpDir/failed_build ]]; then
find "./build/<<parameters.arch>>/" -name "*.log" -type f -mmin -1 |
while read log; do
echo ""
echo '==>' "$log" '<=='
echo ""
cat "$log"
done
find "./build/<<parameters.arch>>/" -name "*.log" -type f -mmin -1 -exec tail -n +1 '{}' +
exit 1
else
echo "Step hasn't failed. Continuing with next step..."
Expand Down Expand Up @@ -571,7 +565,6 @@ workflows:
subcommand: ""
requires:
- nitropad-nv41

# - build:
# name: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard
# target: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard
Expand Down

0 comments on commit de3f4ec

Please sign in to comment.