Skip to content

Commit 9f7675a

Browse files
committed
ceph-dev-pipeline: check shaman for "are there binaries"
Checking chacra isn't the right check, since this build's chacra url is not necessarily the prior successful build's chacra url (there are multiple chacra instances). Instead, check shaman to see if there is a built repo; if so, the build can be skipped. build_container will search shaman again to find the repo url to use to build the container, if necessary. Signed-off-by: Dan Mick <dan.mick@redhat.com>
1 parent 1fa094b commit 9f7675a

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

ceph-dev-pipeline/build/Jenkinsfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//
2+
// vim: ts=2 sw=2 expandtab
3+
//
4+
15
import groovy.transform.Field
26

37
@Field String ceph_build_repo = "https://github.com/ceph/ceph-build"
@@ -333,18 +337,13 @@ pipeline {
333337
}
334338
steps {
335339
script {
336-
sh './scripts/setup_chacractl.sh'
337-
def chacra_url = sh(
338-
script: '''grep url ~/.chacractl | cut -d'"' -f2''',
339-
returnStdout: true,
340-
).trim()
341340
def os = get_os_info(env.DIST)
342-
def chacra_endpoint = "ceph/${env.BRANCH}/${env.SHA1}/${os.name}/${os.version_name}/${env.ARCH}/flavors/${env.FLAVOR}/"
343-
def chacractl_rc = sh(
344-
script: "$HOME/.local/bin/chacractl exists binaries/${chacra_endpoint}",
345-
returnStatus: true,
346-
)
347-
if ( chacractl_rc == 0 && env.FORCE != "true" ) {
341+
def shaman_endpoint = "https://shaman.ceph.com/api/repos/ceph/${env.BRANCH}/${env.SHA1}/${os.name}/${os.version_name}"
342+
def chacra_repo_url = sh(
343+
script: '''curl -s -S --retry 4 ${shaman_endpoint} | jq -r 'first(.[] | select(.flavor == "env.FLAVOR" and (.archs | any(. == "env.ARCH")) and .status=="ready")) | .chacra_url''',
344+
returnStdout: true
345+
).trim()
346+
if ( chacra_repo_url != "" && env.FORCE != "true" ) {
348347
println("Skipping compilation since chacra already has artifacts. To override, use THROWAWAY=true (to skip this check) or FORCE=true (to re-upload artifacts).")
349348
build_matrix["${DIST}_${ARCH}"] = false
350349
}
@@ -549,6 +548,7 @@ pipeline {
549548
}
550549
steps {
551550
script {
551+
sh './scripts/setup_chacractl.sh'
552552
def chacra_url = sh(
553553
script: '''grep url ~/.chacractl | cut -d'"' -f2''',
554554
returnStdout: true,

0 commit comments

Comments
 (0)