]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-*build: move container build to separate script
authorZack Cerza <zack@redhat.com>
Wed, 27 Nov 2024 19:58:11 +0000 (12:58 -0700)
committerZack Cerza <zack@redhat.com>
Fri, 17 Jan 2025 19:56:32 +0000 (12:56 -0700)
ceph-build/config/definitions/ceph-build.yml
ceph-dev-build/build/build_rpm
ceph-dev-build/config/definitions/ceph-dev-build.yml
ceph-dev-new-build/build/build_rpm
ceph-dev-new-build/build/setup_rpm
ceph-dev-new-build/config/definitions/ceph-dev-new-build.yml
scripts/build_container [new file with mode: 0755]

index c7cd1b4d2515845008a8e89236a978fff679714f..30dc290ef87eb9714d72a2476fae2270ca8bb925 100644 (file)
                   - ../../../scripts/build_utils.sh
                   - ../../build/setup_rpm
                   - ../../build/build_rpm
+                  - ../../../scripts/build_container
                   - ../../../scripts/status_completed
     publishers:
       - postbuildscript:
index c2bb23b023b59d6ea2639ef1f46c311334bbb02a..061168741b8c7f0294ac30ea3e12ee7ebca38146 100644 (file)
@@ -81,26 +81,3 @@ EOF
 
     echo Check the status of the repo at: https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/
 fi
-
-# XXX perhaps use job parameters instead of literals; then
-# later stages can also use them to compare etc.
-if [[ "$CI_CONTAINER" == true && $DISTRO == "centos" && "$RELEASE" =~ 8|9 ]] ; then
-    loop=0
-    ready=false
-    while ((loop < 15)); do
-      curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" > shaman.status
-      if [[ ($(jq -r '.[0].extra.build_url' < shaman.status) == ${BUILD_URL}) && ($(jq -r '.[0].status' < shaman.status) == 'ready') ]] ; then ready=true; break; fi
-      ((loop = loop + 1))
-      sleep 60
-    done
-
-    if [[ "$ready" == "false" ]] ; then
-      echo "FAIL: timed out waiting for shaman repo to be built:  https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/"
-      # don't fail the build here on purpose
-      # update_build_status "failed" "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
-      # exit 1
-    fi
-    # get into $WORKSPACE/$dist/ceph-$cephver, where the copied source tree is
-    cd ${WORKSPACE}/dist/ceph-${cephver}/container
-    CEPH_SHA1=${SHA1} ./build.sh
-fi
index da0733a51198b3221b6e54cad95a2ac017778e93..df4e71dae89ba69bd11715cbf519a42c2c9bc85f 100644 (file)
@@ -92,6 +92,7 @@
             - ../../../scripts/build_utils.sh
             - ../../build/setup_rpm
             - ../../build/build_rpm
+            - ../../../scripts/build_container
             - ../../../scripts/status_completed
       # osc build scripts
       - shell:
index 142c520d1076abca83144bec11aec1562a4a4f1d..da72c25a6f5554eb8d5cd73821c2ecdf402bd676 100644 (file)
@@ -84,27 +84,3 @@ EOF
 
     echo Check the status of the repo at: https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/
 fi
-
-# XXX perhaps use job parameters instead of literals; then
-# later stages can also use them to compare etc.
-# build container image that supports building crimson-osd
-if [[ $CI_CONTAINER == "true" && $DISTRO == "centos" && "$RELEASE" =~ 8|9 ]] ; then
-    loop=0
-    ready=false
-    while ((loop < 15)); do
-      curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" > shaman.status
-      if [[ ($(jq -r '.[0].extra.build_url' < shaman.status) == ${BUILD_URL}) && ($(jq -r '.[0].status' < shaman.status) == 'ready') ]] ; then ready=true; break; fi
-      ((loop = loop + 1))
-      sleep 60
-    done
-
-    if [[ "$ready" == "false" ]] ; then
-      echo "FAIL: timed out waiting for shaman repo to be built:  https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/"
-      # don't fail the build here on purpose
-      # update_build_status "failed" "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
-      # exit 1
-    fi
-    # get into $WORKSPACE/$dist/ceph-$cephver, where the copied source tree is
-    cd ${WORKSPACE}/dist/ceph-${cephver}/container
-    CEPH_SHA1=${SHA1} ./build.sh
-fi
index 8a6908b60aabaeb8afdf80209dfaa96cd075fdcb..068597ce2262c9f843db4656a8f5ca1a8b5f3244 100644 (file)
@@ -44,10 +44,6 @@ pwd
 
 setup_rpm_build_deps
 
-if [[ $CI_CONTAINER == "true" && $DISTRO == "centos" && "$RELEASE" =~ 8|9 ]] ; then
-      podman login -u $CONTAINER_REPO_USERNAME -p $CONTAINER_REPO_PASSWORD $CONTAINER_REPO_HOSTNAME/$CONTAINER_REPO_ORGANIZATION
-fi
-
 cd $WORKSPACE
 
 pkgs=( "chacractl>=0.0.21" )
index 1ddba7ee8e54e7188a912baf9095a5afcf057f8d..a6a56034ea4d4f5965e900ef6a3c5df9da71dcbc 100644 (file)
             - ../../../scripts/setup_sccache.sh
             - ../../build/setup_rpm
             - ../../build/build_rpm
+            - ../../../scripts/build_container
             - ../../../scripts/status_completed
       # osc build scripts
       - shell:
diff --git a/scripts/build_container b/scripts/build_container
new file mode 100755 (executable)
index 0000000..5ac6087
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: ts=4 sw=4 expandtab
+set -ex
+PS4="\$(date --rfc-3339=seconds) + "
+
+# XXX perhaps use job parameters instead of literals; then
+# later stages can also use them to compare etc.
+# build container image that supports building crimson-osd
+if [[ $CI_CONTAINER == "true" && $DISTRO == "centos" && "$RELEASE" =~ 8|9 ]] ; then
+    podman login -u $CONTAINER_REPO_USERNAME -p $CONTAINER_REPO_PASSWORD $CONTAINER_REPO_HOSTNAME/$CONTAINER_REPO_ORGANIZATION
+    loop=0
+    ready=false
+    while ((loop < 15)); do
+      curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" > shaman.status
+      if [[ ($(jq -r '.[0].extra.build_url' < shaman.status) == ${BUILD_URL}) && ($(jq -r '.[0].status' < shaman.status) == 'ready') ]] ; then ready=true; break; fi
+      ((loop = loop + 1))
+      sleep 60
+    done
+
+    if [[ "$ready" == "false" ]] ; then
+      chacra_endpoint="ceph/${BRANCH}/${SHA1}/${DISTRO}/${RELEASE}"
+      echo "FAIL: timed out waiting for shaman repo to be built:  https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/"
+      # don't fail the build here on purpose
+      # update_build_status "failed" "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
+      # exit 1
+    fi
+    # get into $WORKSPACE/$dist/ceph-$cephver, where the copied source tree is
+    cd ${WORKSPACE}/dist/ceph-${cephver}/container
+    CEPH_SHA1=${SHA1} ./build.sh
+fi