]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline: Fix extract/upload of cephadm 2363/head
authorZack Cerza <zack@cerza.org>
Wed, 7 May 2025 18:02:41 +0000 (12:02 -0600)
committerZack Cerza <zack@cerza.org>
Wed, 7 May 2025 23:28:45 +0000 (17:28 -0600)
Signed-off-by: Zack Cerza <zack@cerza.org>
ceph-dev-pipeline/build/Jenkinsfile
scripts/chacra_upload.sh

index ea8917e73b1abb5cac7b7747c37d145a7a346a37..af053e0aad33f03a0b0c4dfe268643e50b4912e4 100644 (file)
@@ -351,6 +351,9 @@ pipeline {
                 env.AWS_ACCESS_KEY_ID = env.SCCACHE_BUCKET_CREDS_USR
                 env.AWS_SECRET_ACCESS_KEY = env.SCCACHE_BUCKET_CREDS_PSW
                 sh 'echo > .env'
+                def ceph_builder_tag = "${env.SHA1[0..6]}.${env.BRANCH}.${env.DIST}.${ARCH}"
+                def bwc_command_base = "python3 src/script/build-with-container.py --image-repo=${env.CEPH_BUILDER_IMAGE} --tag=${ceph_builder_tag} -d ${DIST} --ceph-version ${env.VERSION}"
+                def bwc_command = bwc_command_base
                 def bwc_cmd_sccache_flags = ""
                 if ( env.DWZ == "false" ) {
                   sh '''#!/bin/bash
@@ -383,9 +386,7 @@ pipeline {
                   )
                   bwc_cmd_sccache_flags = "--env-file=${env.WORKSPACE}/.env";
                 }
-                def ceph_builder_tag = "${env.SHA1[0..6]}.${env.BRANCH}.${env.DIST}.${ARCH}"
-                def bwc_command_base = "python3 src/script/build-with-container.py ${bwc_cmd_sccache_flags} --image-repo=${env.CEPH_BUILDER_IMAGE} --tag=${ceph_builder_tag} -d ${DIST} --ceph-version ${env.VERSION}"
-                def bwc_command = bwc_command_base
+                bwc_command = "${bwc_command} ${bwc_cmd_sccache_flags}"
                 if ( os.pkg_type == "deb" ) {
                   def sccache_flag = "-DWITH_SCCACHE=ON"
                   if ( env.SCCACHE == "true" && ! env.CEPH_EXTRA_CMAKE_ARGS.contains(sccache_flag) ) {
@@ -404,12 +405,24 @@ pipeline {
                 } else {
                   throw new Exception("DIST '${env.DIST}' is invalid!")
                 }
-                sh """#!/bin/bash
-                    set -ex
-                    cd dist/ceph
-                    ln ../ceph-${env.VERSION}.tar.bz2 .
-                    ${bwc_command}
+                sh """#!/bin/bash -ex
+                  cd dist/ceph
+                  ln ../ceph-${env.VERSION}.tar.bz2 .
+                  ${bwc_command}
                 """
+                if ( os.pkg_type == "deb" ) {
+                  sh """#!/bin/bash -ex
+                    cd dist/ceph
+                    ${bwc_command_base} -e custom -- "dpkg-deb --fsys-tarfile /ceph/debs/*/pool/main/c/ceph/cephadm_${VERSION}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm"
+                    ln ./cephadm ../../
+                  """
+                } else if ( env.DIST =~ /^(centos|rhel|fedora).*/ ) {
+                  sh """#!/bin/bash -ex
+                    cd dist/ceph
+                    ${bwc_command_base} -e custom -- "rpm2cpio /ceph/rpmbuild/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm"
+                    ln ./cephadm ../../
+                  """
+                }
               }
             }
             post {
index e68b1ad562934d95863285ee480f6606856dd713..2ea7621b45c8b6e2daf80140f5a689a274ba9e61 100755 (executable)
@@ -14,8 +14,7 @@ if [ "$OS_PKG_TYPE" = "rpm" ]; then
   BUILDAREA="${WORKSPACE}/dist/ceph/rpmbuild"
   find dist/ceph/rpmbuild/SRPMS | grep rpm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR}
   find dist/ceph/rpmbuild/RPMS/* | grep rpm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
-  if [ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ] ; then
-      rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+  if [ -f ./cephadm ] ; then
       echo cephadm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
   fi
 elif [ "$OS_PKG_TYPE" = "deb" ]; then
@@ -24,9 +23,8 @@ elif [ "$OS_PKG_TYPE" = "deb" ]; then
     egrep "*(\.changes|\.deb|\.ddeb|\.dsc|ceph[^/]*\.gz)$" | \
     egrep -v "(Packages|Sources|Contents)" | \
     chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
-  # FIXME need the real path here
-  if [ -f release/${VERSION}/cephadm_${VERSION}*.deb ] ; then
-    dpkg-deb --fsys-tarfile release/${VERSION}/cephadm_${VERSION}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm
+  BUILDAREA="${WORKSPACE}/dist/ceph/debs"
+  if [ -f ./cephadm ] ; then
     echo cephadm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
   fi
 fi