From e32ae9b0a1713e38aa7fd55d101557436a726243 Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Tue, 6 Apr 2021 10:15:39 +0800 Subject: [PATCH] test --- script/make_version.sh | 10 ++++++++-- script/setup_env.sh | 3 ++- script/tools/chroot.sh | 1 + script/tools/util.sh | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/script/make_version.sh b/script/make_version.sh index d59b428..c1b5e2a 100644 --- a/script/make_version.sh +++ b/script/make_version.sh @@ -40,20 +40,26 @@ function get_repose() exit [lindex \$result 3] " } +if [ -n ${RELEASE_SERVER_PORT} ];then + ssh_port="-p ${RELEASE_SERVER_PORT}" +else + ssh_port="" +fi for((i=0;i<3;i++)); do -ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} ip addr | grep "172." | tr -cd "[0-9].[0-9]/ " | awk '{print $3}' | awk -F "/" '{print $1}') +ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa ${ssh_port} root@${RELEASE_SERVER_IP} ip addr | grep inet | awk '{print $2}' | grep -v '127' | awk -F '/' '{print $1}' | sed -n '1p') if [ "$ret" != "${RELEASE_SERVER_IP}" ];then break fi done -#sed -i "s/RELEASE_SERVER_IP=\"${RELEASE_SERVER_IP}\"/RELEASE_SERVER_IP=\"$ret\"/g" "${BUILD_SCRIPT_DIR}"/setup_env.sh +sed -i "s/RELEASE_SERVER_IP=\"${RELEASE_SERVER_IP}\"/RELEASE_SERVER_IP=\"$ret\"/g" "${BUILD_SCRIPT_DIR}"/setup_env.sh #sh "${BUILD_SCRIPT_DIR}"/tools/safe_sshcmd.sh -c "ip add | grep 172 | awk -F '/' '{print \$1}'| awk '{print \$2}'" -m ${RELEASE_SERVER_IP} -u "root" -p "xxxx" -t 120 -n 3 #if echo "${CI_PROJECT}" | grep '_gcov'; then # modify_for_gcov "${BUILD_SCRIPT_DIR}" # source "${BUILD_SCRIPT_DIR}"/config.sh || exit 1 #fi source "${BUILD_SCRIPT_DIR}"/common_function.sh || exit 1 +source "${BUILD_SCRIPT_DIR}"/setup_env.sh || exit 1 export EXCLUDE_REGISTER_SCRIPT=('set_release_dir') sed -i 's/container=.*>/container=\"'${CONTAINER_NAME}'\">/g' "${BUILD_SCRIPT_DIR}"/config/docker_image/config.xml diff --git a/script/setup_env.sh b/script/setup_env.sh index 6562cd9..b0eb1d1 100644 --- a/script/setup_env.sh +++ b/script/setup_env.sh @@ -10,7 +10,8 @@ export OS_VERSION="$(echo ${tmp//:/-})" export OBS_UI_IP="172.16.1.81" export OBS_SERVER_IP="172.16.1.95" -export RELEASE_SERVER_IP="172.17.4.28" +export RELEASE_SERVER_IP="172.16.1.241" +export RELEASE_SERVER_PORT="30322" export ARCH=$(uname -m) export RELEASE_HTTP_URL="http://121.36.84.172/dailybuild" diff --git a/script/tools/chroot.sh b/script/tools/chroot.sh index 5cbc14d..66b29ee 100644 --- a/script/tools/chroot.sh +++ b/script/tools/chroot.sh @@ -25,6 +25,7 @@ function chroot_init() sed -i '/VERSION=/ iexport CI_PROJECT="openeuler_ARM64_gcov"' "${OPENEULER_CHROOT_PATH}"/home/internal.sh fi chroot "${OPENEULER_CHROOT_PATH}" /bin/bash -c "echo ${OBS_SERVER_IP} openeuler-obs-repo.huawei.com >> /etc/hosts" + chroot "${OPENEULER_CHROOT_PATH}" /bin/bash -c "bash -x /home/setup_env.sh" } function chroot_clean() diff --git a/script/tools/util.sh b/script/tools/util.sh index 476f28b..1e1821a 100644 --- a/script/tools/util.sh +++ b/script/tools/util.sh @@ -2,7 +2,6 @@ # Author: yhon # Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved. set -e - ###################### # 输出info等级的日志 # Globals: @@ -80,6 +79,7 @@ function sshscp() ###################### function sshscp_from() { + echo "==== ${RELEASE_SERVER_IP} ====" sh "${BUILD_SCRIPT_DIR}/tools/safe_sshscp.sh" -s "${RELEASE_SERVER_IP}:$1" -d "$2" -r -t 120 -n 3 #sh "${BUILD_SCRIPT_DIR}/tools/safe_sshscp.sh" -p "${PASSWD}" -s "${RELEASE_SERVER_IP}:$1" -d "$2" -r -t 120 -n 3 } -- Gitee