]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline: optionally skip package build
authorZack Cerza <zack@redhat.com>
Mon, 23 Dec 2024 22:06:56 +0000 (15:06 -0700)
committerZack Cerza <zack@cerza.org>
Wed, 5 Feb 2025 19:53:39 +0000 (12:53 -0700)
Signed-off-by: Zack Cerza <zack@cerza.org>
ceph-dev-pipeline/build/Jenkinsfile
ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml
scripts/build_container

index 7e2594f82c809f945390a26646e42c051269614f..626871089cf140c335c0788476b539bdc57aea0d 100644 (file)
@@ -45,6 +45,13 @@ pipeline {
           allOf {
             expression { env.DISTROS.contains(env.DIST) }
             expression { env.ARCHS.contains(env.ARCH) }
+            anyOf {
+              environment name: "CI_COMPILE", value: "true"
+              allOf {
+                environment name: "CI_CONTAINER", value: "true"
+                environment name: "DIST", value: "centos9"
+              }
+            }
           }
         }
         axes {
@@ -81,10 +88,17 @@ pipeline {
             }
             stage("copy artifacts") {
               steps {
+                script {
+                  if ( env.CI_COMPILE == "true" ) {
+                    env.ARTIFACT_FILTER = "dist/**"
+                  } else {
+                    env.ARTIFACT_FILTER = "dist/sha1,dist/version,dist/other_envvars,dist/ceph_*.orig.tar.gz"
+                  }
+                }
                 copyArtifacts(
                   projectName: "ceph-dev-new-setup",
                   selector: specific(buildNumber: env.SETUP_BUILD_ID),
-                  filter: "dist/sha1,dist/version,dist/other_envvars,dist/ceph_*.orig.tar.gz",
+                  filter: env.ARTIFACT_FILTER,
                 )
                 script {
                   def sha1_props = readProperties file: "${WORKSPACE}/dist/sha1"
@@ -135,7 +149,7 @@ pipeline {
                     . ./scripts/build_utils.sh
                     . ./scripts/setup_sccache.sh
                     . ./ceph-dev-new-build/build/setup_rpm
-                    [ "$CI_BUILD" = "true" ] || exit 0
+                    [ "$CI_COMPILE" = "true" ] || exit 0
                     reset_sccache
                     . ./ceph-dev-new-build/build/build_rpm
                   """
index 2fef907c7e94ded404322f1fb7a84d7d9542ff83..076591c0e1b1e1d0b09982220429ea5e795f63a5 100644 (file)
           description: "A list of architectures to build for. Available options are: x86_64 and arm64"
           default: "x86_64 arm64"
 
+      - bool:
+          name: CI_COMPILE
+          description: "Whether to compile and build packages"
+          default: true
+
       - bool:
           name: THROWAWAY
           description: "Whether to push any binaries to Chacra"
index 5ac6087b4579f31de37f33bc590847442d1ee945..bd127317490b9917d71be1d1fb9c0ca10f497b19 100755 (executable)
@@ -12,7 +12,17 @@ if [[ $CI_CONTAINER == "true" && $DISTRO == "centos" && "$RELEASE" =~ 8|9 ]] ; t
     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
+      if [[ ($(jq -r '.[0].status' < shaman.status) == 'ready') ]]; then
+        # If we skipped compilation, we will not have generated a shaman build,
+        # so skip validating against extra.build_url
+        if [[ ${CI_COMPILE:-true} == "false" ]]; then
+          ready=true
+          break
+        elif [[ ($(jq -r '.[0].extra.build_url' < shaman.status) == ${BUILD_URL}) ]]; then
+          ready=true
+          break
+        fi
+      fi
       ((loop = loop + 1))
       sleep 60
     done