From 9f667b7dba11b7c348826b94ff91116af131ed9d Mon Sep 17 00:00:00 2001 From: XZhouQD Date: Wed, 16 Dec 2020 11:42:41 +0800 Subject: [PATCH 1/2] Fix: call mirror in build to avoid multi-file bug Signed-off-by: XZhouQD --- bin/build | 6 +++--- bin/pre-build | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/build b/bin/build index 87e5671..06bbe2d 100755 --- a/bin/build +++ b/bin/build @@ -4,11 +4,11 @@ for f in ${SRC_FILES[@]} do - [ -f "$build_dir/$f" ] || continue + [ -f "$build_dir/$f-mirror" ] || continue # Dockerfile - [[ -n "$(echo $f | grep Dockerfile)" ]] && - CUR_DC_BUILD_TASK+=("$f") + [[ -n "$(echo $f-mirror | grep Dockerfile)" ]] && + CUR_DC_BUILD_TASK+=("$f-mirror") done unset f diff --git a/bin/pre-build b/bin/pre-build index 588ee7c..3cd904f 100755 --- a/bin/pre-build +++ b/bin/pre-build @@ -30,17 +30,13 @@ done > $log_file rsync -aPz $REPO_DCFILE_DIR/$SRC_PATH/* $build_dir/$SRC_PATH/ > /dev/null 2>&1 -mirror_files=() for f in ${SRC_FILES[@]} do [ -f "$build_dir/$f" ] || continue [[ -n "$(echo $f | grep Dockerfile)" ]] && $REPO_BIN_DIR/fix-mirrors-network $build_dir/$f - mirror_files+=( $f-mirror ) done -SRC_FILES=( "${mirror_files[@]}" ) - log "Actuator IP: $ipaddr" $log_file log "Actuator OS: $os_info" $log_file log "Actuator ARCH: $os_arch" $log_file -- Gitee From c6e570f45bfc35745ecddb8aa153993ffcd02fec Mon Sep 17 00:00:00 2001 From: XZhouQD Date: Wed, 16 Dec 2020 19:44:35 +0800 Subject: [PATCH 2/2] Fix: use instance variable to handle array to avoid failure Signed-off-by: XZhouQD --- bin/build | 6 +++--- bin/pre-build | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/build b/bin/build index 06bbe2d..87e5671 100755 --- a/bin/build +++ b/bin/build @@ -4,11 +4,11 @@ for f in ${SRC_FILES[@]} do - [ -f "$build_dir/$f-mirror" ] || continue + [ -f "$build_dir/$f" ] || continue # Dockerfile - [[ -n "$(echo $f-mirror | grep Dockerfile)" ]] && - CUR_DC_BUILD_TASK+=("$f-mirror") + [[ -n "$(echo $f | grep Dockerfile)" ]] && + CUR_DC_BUILD_TASK+=("$f") done unset f diff --git a/bin/pre-build b/bin/pre-build index 3cd904f..b0b2586 100755 --- a/bin/pre-build +++ b/bin/pre-build @@ -37,6 +37,9 @@ do $REPO_BIN_DIR/fix-mirrors-network $build_dir/$f done +copy_files=( $SRC_FILES ) +SRC_FILES="${copy_files[@]/%/-mirror}" + log "Actuator IP: $ipaddr" $log_file log "Actuator OS: $os_info" $log_file log "Actuator ARCH: $os_arch" $log_file -- Gitee