From e526b71d917dc8cf687e6ec97a9d1e819a489c92 Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Thu, 31 Dec 2020 15:24:28 +0800 Subject: [PATCH] change http url which will be writen in release file --- script/make_version.sh | 2 +- script/setup_env.sh | 1 + script/step/get_epol_rpms.sh | 1 + script/step/make_debug_everything.sh | 23 ++++++++--------------- script/step/make_iso.sh | 24 +++++++++--------------- script/step/make_iso_everysrc.sh | 24 +++++++++--------------- script/step/make_iso_everything.sh | 22 ++++++++-------------- script/step/make_netinst_iso.sh | 21 ++++++++------------- 8 files changed, 45 insertions(+), 73 deletions(-) diff --git a/script/make_version.sh b/script/make_version.sh index 8b67810..a315b8d 100644 --- a/script/make_version.sh +++ b/script/make_version.sh @@ -46,7 +46,7 @@ if [ "$ret" != "${RELEASE_SERVER_IP}" ];then break fi done -sed -i "s/${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}" diff --git a/script/setup_env.sh b/script/setup_env.sh index b89fcdc..272f966 100644 --- a/script/setup_env.sh +++ b/script/setup_env.sh @@ -12,6 +12,7 @@ export OBS_UI_IP="172.16.1.81" export OBS_SERVER_IP="172.16.1.95" export RELEASE_SERVER_IP="121.36.84.172" export ARCH=$(uname -m) +export RELEASE_HTTP_URL="http://121.36.84.172/dailybuild" SUB_STANDARD_REPO_URL="$(echo ${OBS_STANDARD_PROJECT//:/:\/})" SUB_EPOL_REPO_URL="$(echo ${OBS_EPOL_PROJECT//:/:\/})" diff --git a/script/step/get_epol_rpms.sh b/script/step/get_epol_rpms.sh index 7806683..76c341d 100644 --- a/script/step/get_epol_rpms.sh +++ b/script/step/get_epol_rpms.sh @@ -31,6 +31,7 @@ function get_epol_rpms_inchroot() RELEASE_DIR="${release_dir}/EPOL/$ARCH/Packages" RELEASE_SOURCE_DIR="${release_dir}/EPOL/source/Packages" SSH_CMD="mkdir -p ${RELEASE_DIR}" + sshcmd "${SSH_CMD}" SSH_CMD="mkdir -p ${RELEASE_SOURCE_DIR}" sshcmd "${SSH_CMD}" SSH_CMD="cd ${RELEASE_DIR} && wget -c -r -np -nd ${OBS_EPOL_REPO_URL}/${ARCH}/ && rm -rf ${ARCH} && rm -rf index.html*" diff --git a/script/step/make_debug_everything.sh b/script/step/make_debug_everything.sh index b9b5808..051c89e 100644 --- a/script/step/make_debug_everything.sh +++ b/script/step/make_debug_everything.sh @@ -94,27 +94,20 @@ function make_debug_everything_inchroot() if [ $? -ne 0 ]; then log_error "Failed in chmod_http" fi - log_info "Release iso to http://${RELEASE_SERVER_IP}/${CUSTOM_DIR}/" release_file="release_debug_everything" - SSH_CMD="echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" + sub_dir=`echo ${RELEASE_DIR#*/dailybuild}` + SSH_CMD="echo ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" sshcmd "${SSH_CMD}" - log_info "echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${release_file}" - - if [ "${ISCI}" -eq "0" ]; then - return 0 - fi - - mkdir -pv "${WORK_DIR}"output - html="${WORK_DIR}"output/release_debug_everything.html - cat /dev/null > "${html}" + DATE=`echo ${release_dir#*openeuler-}` + html="release_debug_everything.html" echo "" >> "${html}" echo '
' >> "${html}" echo "

The newest ${VERSION} Release

" >> "${html}" - echo "The release is created on $(date)" >> "${html}" - echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" - echo "

Download on linux: run \"wget http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME}\"

" >> "${html}" - echo "

View the history version, please go to : http://${RELEASE_SERVER_IP}/${PRE_VERSION}/

" >> "${html}" + echo "The release is created on ${DATE}" >> "${html}" + echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" + echo "

Download on linux: run \"wget ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME}\"

" >> "${html}" + echo "

View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/

" >> "${html}" echo "
" >> "${html}" echo "" >> "${html}" set +e diff --git a/script/step/make_iso.sh b/script/step/make_iso.sh index 99746c0..54430e3 100644 --- a/script/step/make_iso.sh +++ b/script/step/make_iso.sh @@ -91,29 +91,23 @@ function make_iso_inchroot() set -e [ -n "${iso_rpmlist}" ] && rm -rf "${iso_rpmlist}" - log_info "Release iso to http://${RELEASE_SERVER_IP}:82/${CUSTOM_DIR}/" release_file="release_iso" - SSH_CMD="echo http://${RELEASE_SERVER_IP}:82/${RELEASE_DIR}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" + sub_dir=`echo ${RELEASE_DIR#*/dailybuild}` + SSH_CMD="echo http://${RELEASE_SERVER_IP}/dailybuild/${sub_dir}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" sshcmd "${SSH_CMD}" - log_info "echo http://${RELEASE_SERVER_IP}:82/${RELEASE_DIR}/${TGZ_NAME} > ${release_file}" - if [ "${ISCI}" -eq "0" ]; then - return 0 - fi - mkdir -pv "${WORK_DIR}"output - html="${WORK_DIR}"output/release_iso.html - cat /dev/null > "${html}" + DATE=`echo ${release_dir#*openeuler-}` + html="release_iso.html" echo "" >> "${html}" echo '
' >> "${html}" echo "

The newest ${VERSION} Release

" >> "${html}" - echo "The release is created on $(date)" >> "${html}" - echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" - echo "

Download on linux: run \"wget http://${RELEASE_SERVER_IP}/${CUSTOM_DIR}/${TGZ_NAME}\"

" >> "${html}" - echo "

View the history version, please go to : http://${RELEASE_SERVER_IP}/${PRE_VERSION}/

" >> "${html}" + echo "The release is created on ${DATE}" >> "${html}" + echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" + echo "

Download on linux: run \"wget ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME}\"

" >> "${html}" + echo "

View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/

" >> "${html}" echo "
" >> "${html}" echo "" >> "${html}" - set +e - sshscp "${html}" "${HTTP_DIR}/${PRE_VERSION}/${VERSION}" + sshscp "${html}" "${HTTP_DIR}/${PRE_VERSION}/${VERSION}/" SSH_CMD="chmod 755 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${html##*/}" sshcmd "${SSH_CMD}" set -e diff --git a/script/step/make_iso_everysrc.sh b/script/step/make_iso_everysrc.sh index 34a3193..0266295 100644 --- a/script/step/make_iso_everysrc.sh +++ b/script/step/make_iso_everysrc.sh @@ -91,31 +91,25 @@ function make_iso_everysrc_inchroot() if [ $? -ne 0 ]; then log_error "Failed in chmod_http" fi - log_info "Release iso to http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/" release_file="release_source" - SSH_CMD="echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" + sub_dir=`echo ${RELEASE_DIR#*/dailybuild}` + SSH_CMD="echo ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" sshcmd "${SSH_CMD}" - log_info "echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${release_file}" - - if [ "${ISCI}" -eq "0" ]; then - return 0 - fi sed +e - mkdir -pv "${WORK_DIR}"output - html="${WORK_DIR}"output/release_iso_source.html - cat /dev/null > "${html}" + DATE=`echo ${release_dir#*openeuler-}` + html="release_iso_source.html" echo "" >> "${html}" echo '
' >> "${html}" echo "

The newest ${VERSION} Release

" >> "${html}" - echo "The release is created on $(date)" >> "${html}" - echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" - echo "

Download on linux: run \"wget http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME}\"

" >> "${html}" - echo "

View the history version, please go to : http://${RELEASE_SERVER_IP}/${PRE_VERSION}/

" >> "${html}" + echo "The release is created on ${DATE}" >> "${html}" + echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" + echo "

Download on linux: run \"wget ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME}\"

" >> "${html}" + echo "

View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/

" >> "${html}" echo "
" >> "${html}" echo "" >> "${html}" set +e - sshscp "${html}" "${HTTP_DIR}/${PRE_VERSION}/${VERSION}" + sshscp "${html}" "${HTTP_DIR}/${PRE_VERSION}/${VERSION}/" SSH_CMD="chmod 755 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${html##*/}" sshcmd "${SSH_CMD}" chmod_http diff --git a/script/step/make_iso_everything.sh b/script/step/make_iso_everything.sh index d0a0e55..afc6f23 100644 --- a/script/step/make_iso_everything.sh +++ b/script/step/make_iso_everything.sh @@ -93,27 +93,21 @@ function make_iso_everything_inchroot() if [ $? -ne 0 ]; then log_error "Failed in chmod_http" fi - log_info "Release iso to http://${RELEASE_SERVER_IP}/${CUSTOM_DIR}/" release_file="release_everything" - SSH_CMD="echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" + sub_dir=`echo ${RELEASE_DIR#*/dailybuild}` + SSH_CMD="echo ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" sshcmd "${SSH_CMD}" - log_info "echo http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME} > ${release_file}" - if [ "${ISCI}" -eq "0" ]; then - return 0 - fi - - mkdir -pv "${WORK_DIR}"output - html="${WORK_DIR}"output/release_iso_everything.html - cat /dev/null > "${html}" + DATE=`echo ${release_dir#*openeuler-}` + html="release_iso_everything.html" echo "" >> "${html}" echo '
' >> "${html}" echo "

The newest ${VERSION} Release

" >> "${html}" - echo "The release is created on $(date)" >> "${html}" - echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" - echo "

Download on linux: run \"wget http://${RELEASE_SERVER_IP}/${RELEASE_DIR}/${TGZ_NAME}\"

" >> "${html}" - echo "

View the history version, please go to : http://${RELEASE_SERVER_IP}/${PRE_VERSION}/

" >> "${html}" + echo "The release is created on ${DATE}" >> "${html}" + echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" + echo "

Download on linux: run \"wget ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME}\"

" >> "${html}" + echo "

View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/

" >> "${html}" echo "
" >> "${html}" echo "" >> "${html}" set +e diff --git a/script/step/make_netinst_iso.sh b/script/step/make_netinst_iso.sh index 6c9a58d..5a188e1 100644 --- a/script/step/make_netinst_iso.sh +++ b/script/step/make_netinst_iso.sh @@ -85,27 +85,22 @@ function make_netinst_iso_inchroot() if [ $? -ne 0 ]; then log_error "Failed in chmod_http" fi - log_info "Release iso to http://${RELEASE_SERVER_IP}:82/${CUSTOM_DIR}/" release_file="release_netinst" - SSH_CMD="echo http://${RELEASE_SERVER_IP}:82/${CUSTOM_DIR}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" + sub_dir=`echo ${RELEASE_DIR#*/dailybuild}` + SSH_CMD="echo ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME} > ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}; chmod 644 ${HTTP_DIR}/${PRE_VERSION}/${VERSION}/${release_file}" sshcmd "${SSH_CMD}" - log_info "echo http://${RELEASE_SERVER_IP}:82/${CUSTOM_DIR}/${TGZ_NAME} > ${release_file}" - if [ "${ISCI}" -eq "0" ]; then - return 0 - fi + DATE=`echo ${release_dir#*openeuler-}` - mkdir -pv "${WORK_DIR}"output - html="${WORK_DIR}"output/release_netinst_iso.html - cat /dev/null > "${html}" + html="release_netinst_iso.html" echo "" >> "${html}" echo '
' >> "${html}" echo "

The newest ${VERSION} Release

" >> "${html}" - echo "The release is created on $(date)" >> "${html}" - echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" - echo "

Download on linux: run \"wget http://${RELEASE_SERVER_IP}/${CUSTOM_DIR}/${TGZ_NAME}\"

" >> "${html}" - echo "

View the history version, please go to : http://${RELEASE_SERVER_IP}/${PRE_VERSION}/${VERSION}/

" >> "${html}" + echo "The release is created on ${DATE}" >> "${html}" + echo "

Download on windows: ${TGZ_NAME}
" >> "${html}" + echo "

Download on linux: run \"wget ${RELEASE_HTTP_URL}/${sub_dir}/${TGZ_NAME}\"

" >> "${html}" + echo "

View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/

" >> "${html}" echo "
" >> "${html}" echo "" >> "${html}" set +e -- Gitee