From 19f5aea8585e37df3a80006e53f4791a0fdb5dc0 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 23 Dec 2024 15:06:56 -0700 Subject: [PATCH] ceph-dev-pipeline: optionally skip package build Signed-off-by: Zack Cerza --- ceph-dev-pipeline/build/Jenkinsfile | 18 ++++++++++++++++-- .../config/definitions/ceph-dev-pipeline.yml | 5 +++++ scripts/build_container | 12 +++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index 7e2594f8..62687108 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -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 """ diff --git a/ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml b/ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml index 2fef907c..076591c0 100644 --- a/ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml +++ b/ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml @@ -34,6 +34,11 @@ 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" diff --git a/scripts/build_container b/scripts/build_container index 5ac6087b..bd127317 100755 --- a/scripts/build_container +++ b/scripts/build_container @@ -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 -- 2.39.5