mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
[skip e2e]Add script to export containers log one by one (#17138)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
parent
5344dbd2b6
commit
5256d2c3f4
2
.github/workflows/deploy-test.yaml
vendored
2
.github/workflows/deploy-test.yaml
vendored
@ -146,7 +146,7 @@ jobs:
|
||||
run: |
|
||||
docker-compose ps -a || true
|
||||
mkdir -p logs
|
||||
docker-compose logs > ./logs/test-${{ matrix.mode }}-${{ matrix.task }}.log 2>&1 || echo "export logs failed"
|
||||
bash ../../../scripts/export_log_docker.sh ./logs || echo "export logs failed"
|
||||
- name: 'Send mail'
|
||||
if: ${{ failure() }}
|
||||
uses: dawidd6/action-send-mail@v3
|
||||
|
19
tests/scripts/export_log_docker.sh
Normal file
19
tests/scripts/export_log_docker.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately for non zero status
|
||||
set -e
|
||||
|
||||
log_dir=${1:-"logs"}
|
||||
array=($(docker-compose ps -a|awk 'NR == 1 {next} {print $1}'))
|
||||
echo ${array[@]}
|
||||
if [ ! -d $log_dir ];
|
||||
then
|
||||
mkdir -p $log_dir
|
||||
fi
|
||||
echo "export logs start"
|
||||
for container in ${array[*]}
|
||||
do
|
||||
echo "export logs for container $container "
|
||||
docker logs $container > ./$log_dir/$container.log 2>&1 || echo "export logs for container $container failed"
|
||||
done
|
||||
echo "export logs done"
|
Loading…
Reference in New Issue
Block a user