[PATCH v3 compass-ci 5/5] sparrow/4-docker/buildall: prevent duplicate start

[why] when run container which has start depends, some containers will be start many times, so avoid repeated starting containers is necessary. Signed-off-by: Liu Yinsi <liuyinsi@163.com> --- sparrow/4-docker/buildall | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index b24eca5..0d1f161 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -53,10 +53,13 @@ do_one_run() local container=$1 local container_name=$(basename $container) - cd "$container" - [ -x first-run ] && ./first-run - [ -x start ] && ./start - [ "$container_name" == 'initrd-lkp' ] && ./run + mkdir $tmpdir/start_$container_name 2>/dev/null && + ( + cd "$container" + [ -x first-run ] && ./first-run + [ -x start ] && ./start + [ "$container_name" == 'initrd-lkp' ] && ./run + ) } tmpdir=$(mktemp -d) -- 2.23.0
participants (1)
-
Liu Yinsi