diff --git a/industrial_ci/src/tests/ros_prerelease.sh b/industrial_ci/src/tests/ros_prerelease.sh index 1bb7a745e..9b9e0620c 100644 --- a/industrial_ci/src/tests/ros_prerelease.sh +++ b/industrial_ci/src/tests/ros_prerelease.sh @@ -20,9 +20,12 @@ # It is dependent on environment variables that need to be exported in advance # (As of version 0.4.4 most of them are defined in env.sh). +generate_script_path=/usr/local/bin/generate_prerelease_script.py function setup_ros_buildfarm() { - ici_install_pkgs_for_command pip3 python3-pip python3-setuptools python3-wheel - ici_cmd ici_quiet ici_asroot pip3 install git+https://github.com/ros-infrastructure/ros_buildfarm.git + if ! [ -e "$generate_script_path" ]; then + ici_install_pkgs_for_command pip3 python3-pip python3-setuptools python3-wheel + ici_cmd ici_quiet ici_asroot pip3 install git+https://github.com/ros-infrastructure/ros_buildfarm.git + fi } function setup_ros_prerelease() { @@ -41,7 +44,7 @@ function setup_ros_prerelease() { ici_install_pkgs_for_command docker docker.io ici_install_pkgs_for_command sudo sudo ici_install_pkgs_for_command lsb_release lsb-release - ici_exec_for_command generate_prerelease_script.py setup_ros_buildfarm + setup_ros_buildfarm } function prepare_prerelease_workspaces() { @@ -111,7 +114,7 @@ function run_ros_prerelease() { local reponame=${PRERELEASE_REPONAME:-$TARGET_REPO_NAME} ici_step "prepare_prerelease_workspaces" ici_cmd prepare_prerelease_workspaces "$WORKSPACE" "$reponame" "$(basename "$TARGET_REPO_PATH")" - ici_step 'generate_prerelease_script' ici_cmd sudo -EH -u ci generate_prerelease_script.py "${ROSDISTRO_INDEX_URL}" "$PRERELEASE_DISTRO" default "$OS_NAME" "$OS_CODE_NAME" "${OS_ARCH:-amd64}" --build-tool "$BUILDER" --level "$downstream_depth" --output-dir "$WORKSPACE" --custom-repo "$reponame::::" + ici_step 'generate_prerelease_script' ici_cmd sudo -EH -u ci "$generate_script_path" "${ROSDISTRO_INDEX_URL}" "$PRERELEASE_DISTRO" default "$OS_NAME" "$OS_CODE_NAME" "${OS_ARCH:-amd64}" --build-tool "$BUILDER" --level "$downstream_depth" --output-dir "$WORKSPACE" --custom-repo "$reponame::::" # shellcheck disable=SC2016 ici_asroot sed -i '/test_result_EXECUTABLE="colcon"/a mkdir -p "$WORKSPACE/ws/test_results"' "$WORKSPACE/prerelease_build_underlay.sh"