[arvados-dev] updated: 349808c1a4afd4741e9687894bfef063d9fd3413

git repository hosting git at public.arvados.org
Thu Apr 11 13:35:41 UTC 2024


Summary of changes:
 jenkins/testing_to_stable_publish_packages.sh | 101 +++++++++++++-------------
 jenkins/upload_packages_testing_to_stable.sh  |  13 +++-
 2 files changed, 60 insertions(+), 54 deletions(-)

       via  349808c1a4afd4741e9687894bfef063d9fd3413 (commit)
      from  5620086aae58a7f13773fce775aef1b57a3b770c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 349808c1a4afd4741e9687894bfef063d9fd3413
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu Apr 11 09:35:11 2024 -0400

    Fix package publishing script to handle both deb and rpm in one command
    
    no issue #
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/jenkins/testing_to_stable_publish_packages.sh b/jenkins/testing_to_stable_publish_packages.sh
index 053ac7d..835a269 100755
--- a/jenkins/testing_to_stable_publish_packages.sh
+++ b/jenkins/testing_to_stable_publish_packages.sh
@@ -45,58 +45,55 @@ DIST_LIST=$(echo ${distros} | sed s/,/' '/g |tr '[:upper:]' '[:lower:]')
 CENTOS_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\)/\1*\2*/g; s/,/ /g;')
 DEBIAN_PACKAGES=$(echo ${packages} | sed 's/\([a-z-]*\):[[:blank:]]*\([0-9.-]*\)/\1 (= \2)/g;')
 
-if ( echo ${DIST_LIST} |grep -q -E '(centos|rocky)' ); then
-  for DISTNAME in ${DIST_LIST}; do
-    case ${DISTNAME} in
-      'centos7')
-        DIST_DIR_TEST='7/testing/x86_64'
-        DIST_DIR_PROD='7/os/x86_64'
-	;;
-      'rocky8')
-        DIST_DIR_TEST='8/testing/x86_64'
-        DIST_DIR_PROD='8/os/x86_64'
-      ;;
-      *)
-        echo "Only centos7 and rocky8 are accepted right now"
-        exit 253
-      ;;
-    esac
-    cd ${RPM_REPO_BASE_DIR}
-    mkdir -p ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}
-    echo "Copying packages ..."
-    for P in ${CENTOS_PACKAGES}; do
-      cp ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_TEST}/${P} ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}/
-      if [ $? -ne 0 ]; then
-        FAILED_PACKAGES="${FAILED_PACKAGES} ${P}"
-      fi
-    done
-    echo "Recreating repo CentOS/${DIST_DIR_PROD} ..."
-    createrepo_c ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}
-  done
-else
-  for DISTNAME in ${DIST_LIST}; do
-    ADDED=()
-    echo "Copying packages ..."
-    OLDIFS=$IFS
-    IFS=$','
-    for P in ${DEBIAN_PACKAGES}; do
-      aptly repo search ${DISTNAME}-testing "${P}"
-      if [ $? -ne 0 ]; then
-        echo "ERROR: unable to find a match for '${P}' in ${DISTNAME}-testing"
-        FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}"
-      else
-        aptly repo copy ${DISTNAME}-testing ${DISTNAME} "${P}"
-        if [ $? -ne 0 ]; then
-          echo "ERROR: unable to copy '${P}' from ${DISTNAME}-testing to ${DISTNAME}"
-          FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}"
-        fi
-      fi
-    done
-    IFS=$OLDIFS
-    echo "Publishing ${DISTNAME} repository..."
-    aptly publish update ${DISTNAME} filesystem:${DISTNAME}:
-  done
-fi
+for DISTNAME in ${DIST_LIST}; do
+    if ( echo ${DISTNAME} |grep -q -E '(centos|rocky)' ); then
+	case ${DISTNAME} in
+	    'centos7')
+		DIST_DIR_TEST='7/testing/x86_64'
+		DIST_DIR_PROD='7/os/x86_64'
+		;;
+	    'rocky8')
+		DIST_DIR_TEST='8/testing/x86_64'
+		DIST_DIR_PROD='8/os/x86_64'
+		;;
+	    *)
+		echo "Only centos7 and rocky8 are accepted right now"
+		exit 253
+		;;
+	esac
+	cd ${RPM_REPO_BASE_DIR}
+	mkdir -p ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}
+	echo "Copying packages ..."
+	for P in ${CENTOS_PACKAGES}; do
+	    cp ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_TEST}/${P} ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}/
+	    if [ $? -ne 0 ]; then
+		FAILED_PACKAGES="${FAILED_PACKAGES} ${P}"
+	    fi
+	done
+	echo "Recreating repo CentOS/${DIST_DIR_PROD} ..."
+	createrepo_c ${RPM_REPO_BASE_DIR}/CentOS/${DIST_DIR_PROD}
+    else
+	echo "Copying packages ..."
+	OLDIFS=$IFS
+	IFS=$','
+	for P in ${DEBIAN_PACKAGES}; do
+	    aptly repo search ${DISTNAME}-testing "${P}"
+	    if [ $? -ne 0 ]; then
+		echo "ERROR: unable to find a match for '${P}' in ${DISTNAME}-testing"
+		FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}"
+	    else
+		aptly repo copy ${DISTNAME}-testing ${DISTNAME} "${P}"
+		if [ $? -ne 0 ]; then
+		    echo "ERROR: unable to copy '${P}' from ${DISTNAME}-testing to ${DISTNAME}"
+		    FAILED_PACKAGES="${FAILED_PACKAGES} ${DISTNAME}-testing:${P}"
+		fi
+	    fi
+	done
+	IFS=$OLDIFS
+	echo "Publishing ${DISTNAME} repository..."
+	aptly publish update ${DISTNAME} filesystem:${DISTNAME}:
+    fi
+done
 
 if [ "${FAILED_PACKAGES}" != "" ]; then
   echo "PACKAGES THAT FAILED TO PUBLISH"
diff --git a/jenkins/upload_packages_testing_to_stable.sh b/jenkins/upload_packages_testing_to_stable.sh
index b7cff37..4cf3737 100755
--- a/jenkins/upload_packages_testing_to_stable.sh
+++ b/jenkins/upload_packages_testing_to_stable.sh
@@ -23,7 +23,7 @@ fi
 if [ -z "${LSB_DISTRIB_CODENAMES}" ]; then
   echo "You must provide a space-separated list of LSB distribution codenames to which you want to publish to, ie."
   echo "* Debian/Ubuntu: buster, bullseye, focal"
-  echo "* Centos: centos7 (the only one currently supported.)"
+  echo "* Redhat: centos7 rocky8"
   exit 255
 fi
 
@@ -52,11 +52,20 @@ else
   REPO_SERVER=${APT_REPO_SERVER}
 fi
 
-REMOTE_CMD="/usr/local/bin/testing_to_stable_publish_packages.sh --distros ${DISTROS} --packages ${PACKAGES_LIST}"
+# Make sure jenkins scripts are up to date
+ssh -t \
+    -l jenkinsapt \
+    -p $SSH_PORT \
+    -o "StrictHostKeyChecking no" \
+    -o "ConnectTimeout 5" \
+    ${REPO_SERVER} \
+    "cd ~/arvados-dev && git fetch -a && git reset --hard origin/main"
 
 # Now we execute it remotely
 TMP_FILE=`mktemp`
 
+REMOTE_CMD="~/arvados-dev/jenkins/testing_to_stable_publish_packages.sh --distros ${DISTROS} --packages ${PACKAGES_LIST}"
+
 ssh -t \
     -l jenkinsapt \
     -p $SSH_PORT \

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list