]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-*-build: only try extracting cephadm if it exists 1919/head
authorDan Mick <dmick@redhat.com>
Thu, 7 Oct 2021 05:18:24 +0000 (22:18 -0700)
committerDan Mick <dmick@redhat.com>
Thu, 7 Oct 2021 05:19:57 +0000 (22:19 -0700)
https://github.com/ceph/ceph-build/pull/1913 added code to extract
the cephadm binary from its package and push it to chacra; however,
older builds don't include a cephadm package, and ceph-build must
work for those as well.  Broke for nautilus.

Fixes: https://tracker.ceph.com/issues/52847
Signed-off-by: Dan Mick <dmick@redhat.com>
ceph-build/build/build_rpm
ceph-dev-build/build/build_rpm
ceph-dev-new-build/build/build_rpm
scripts/build_utils.sh

index e4f28e0ba6e41a8fb4a931662c2b1e0d4cf3e75f..6e94bd3d1c7d85e9980244158fd2a36bfb2e68bb 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/bash
+# vim: ts=4 sw=4 expandtab
 set -ex
 
 # create a release directory for ceph-build tools
@@ -36,9 +37,11 @@ if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
     find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source
     find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}
-    # extract cephadm
-    rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
-    echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+    # extract cephadm if it exists
+    if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then
+        rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+        echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+    fi
     # write json file with build info
     cat > $WORKSPACE/repo-extra.json << EOF
 {
index 9082fb1af3eb8f2ece2e8c7e545e6d4e7e239793..33a76a8e5b8b6b058012a71df80ef52ceabec019 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/bash
+# vim: ts=4 sw=4 expandtab
 set -ex
 
 # set to "true" or "false" so that both string comparisons
@@ -54,8 +55,12 @@ if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
     find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR}
     find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
-    # extract cephadm
-    rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+    # extract cephadm if it exists
+    if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then
+        rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+        echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+        rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+    fi
     echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
     # write json file with build info
     cat > $WORKSPACE/repo-extra.json << EOF
index 8510b3769fea1ed7e60a31a0d5ff4da27c0ec1da..e7d74b73447d148869f1de483b60555aca3a8f8d 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/bash
+# vim: ts=4 sw=4 expandtab
 set -ex
 
 
@@ -55,9 +56,11 @@ if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
     find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR}
     find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
-    # extract cephadm
-    rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
-    echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+    # extract cephadm if it exists
+    if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then
+        rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm  | cpio -i --to-stdout *sbin/cephadm > cephadm
+        echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+    fi
     # write json file with build info
     cat > $WORKSPACE/repo-extra.json << EOF
 {
index 1dfda6cefb7dfb5efcade85a8a096dc0c2582cee..3f9c9375b337cc9c2cf3c65f4f471ea8ab3ea1cf 100644 (file)
@@ -948,9 +948,11 @@ build_debs() {
             egrep -v "(Packages|Sources|Contents)" | \
             $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint}
 
-        # extract cephadm binary and push
-        dpkg-deb --fsys-tarfile release/${vers}/cephadm_${vers}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm
-        echo cephadm | $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint}
+        # extract cephadm if it exists
+        if [[ -f release/${vers}/cephadm_${vers}*.deb ]] ; then
+            dpkg-deb --fsys-tarfile release/${vers}/cephadm_${vers}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm
+            echo cephadm | $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint}
+        fi
 
         # write json file with build info
         cat > $WORKSPACE/repo-extra.json << EOF