From 6d415c704029c37c8a7ed785b0aa6228d44d2495 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 9 Nov 2016 22:37:58 -0500 Subject: [PATCH] Add back in the code to upload the deps package to xcat.org --- build-ubunturepo | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/build-ubunturepo b/build-ubunturepo index 6eae01394..b4220b4a6 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -96,6 +96,13 @@ if [ -z "$c_flag" -a -z "$d_flag" ];then exit 2 fi +USER="xcat" +SERVER="xcat.org" +FILES_PATH="files" +FRS="/var/www/${SERVER}/${FILES_PATH}" +APT_DIR="${FRS}/xcat" +APT_REPO_DIR="${APT_DIR}/repos/apt" + if [ "$c_flag" -a "$d_flag" ];then printusage exit 2 @@ -474,6 +481,32 @@ __EOF__ chgrp root $dep_tar_name chmod g+w $dep_tar_name + # Decide whether to upload or not (default NOT to upload) + if [ "$UP" != "1" ]; then + echo "Upload not specified, Done! (rerun with UP=1, to upload)" + cd $old_pwd + exit 0 + fi + + #upload the dep packages + i=0 + echo "Uploading debs from xcat-dep to ${APT_REPO_DIR}/xcat-dep/ ..." + while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep $USER@${SERVER}:${APT_REPO_DIR}/ + do : ; done + + #upload the tarball + i=0 + echo "Uploading $dep_tar_name to ${APT_DIR}/xcat-dep/2.x_Ubuntu/ ..." + while [ $((i+=1)) -le 5 ] && ! rsync -v --force $dep_tar_name $USER@${SERVER}:${APT_DIR}/xcat-dep/2.x_Ubuntu/ + do : ; done + + #upload the README file + cd debs + i=0 + echo "Uploading README to ${APT_DIR}/xcat-dep/2.x_Ubuntu/ ..." + while [ $((i+=1)) -le 5 ] && ! rsync -v --force README $USER@${SERVER}:${APT_DIR}/xcat-dep/2.x_Ubuntu/ + do : ; done + cd $old_pwd exit 0 fi