From be7824739f59d7daa133e732fe508d46dc9be6b9 Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Tue, 7 Mar 2017 15:51:55 -0500 Subject: [PATCH] nfs-ganesha: trigger builds from ceph-dev-build Poll shaman repo url every 30 seconds for 10 minutes to ensure binaries are in shaman Signed-off-by: Ali Maredia --- .../config/definitions/ceph-dev-build.yml | 5 +++++ nfs-ganesha/build/build_deb | 22 +++++++++++++++---- nfs-ganesha/build/build_rpm | 22 +++++++++++++++---- .../config/definitions/nfs-ganesha.yml | 15 ------------- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/ceph-dev-build/config/definitions/ceph-dev-build.yml b/ceph-dev-build/config/definitions/ceph-dev-build.yml index 8b3b3d82..660aefe5 100644 --- a/ceph-dev-build/config/definitions/ceph-dev-build.yml +++ b/ceph-dev-build/config/definitions/ceph-dev-build.yml @@ -79,6 +79,11 @@ - ../../../scripts/build_utils.sh - ../../build/setup_rpm - ../../build/build_rpm + - trigger-builds: + - project: "nfs-ganesha" + current-parameters: True + predefined-parameters: + CEPH_BRANCH=$BRANCH publishers: - postbuildscript: diff --git a/nfs-ganesha/build/build_deb b/nfs-ganesha/build/build_deb index b2f00b5a..cde9a613 100644 --- a/nfs-ganesha/build/build_deb +++ b/nfs-ganesha/build/build_deb @@ -7,10 +7,24 @@ if test "$DISTRO" != "debian" -a "$DISTRO" != "ubuntu"; then fi REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$DIST/repo" -SHAMAN_MIRROR=`curl --fail -L ${REPO_URL}` -if [[ ${SHAMAN_MIRROR} ]]; then - echo "Ceph debian lib repo exists in shaman" -else +TIME_LIMIT=600 +INTERVAL=30 +REPO_FOUND=0 + +# poll shaman for up to 10 minutes +while [ "$SECONDS" -le "$TIME_LIMIT" ] +do + SHAMAN_MIRROR=`curl --fail -L ${REPO_URL}` + if [[ ${SHAMAN_MIRROR} ]]; then + echo "Ceph debian lib repo exists in shaman" + REPO_FOUND=1 + break + else + sleep $INTERVAL + fi +done + +if [[ "$REPO_FOUND" -eq 0 ]]; then echo "Ceph debian lib repo does NOT exist in shaman" exit 1 fi diff --git a/nfs-ganesha/build/build_rpm b/nfs-ganesha/build/build_rpm index fd48515a..44f078b6 100644 --- a/nfs-ganesha/build/build_rpm +++ b/nfs-ganesha/build/build_rpm @@ -11,10 +11,24 @@ RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release # Get .repo file from appropriate shaman build REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$RELEASE/flavors/default/repo" -if `curl --fail -L $REPO_URL > $WORKSPACE/shaman.repo`; then - echo "Ceph repo file has been added from shaman" -else - echo "Ceph repo file was NOT added from shaman" +TIME_LIMIT=600 +INTERVAL=30 +REPO_FOUND=0 + +# poll shaman for up to 10 minutes +while [ "$SECONDS" -le "$TIME_LIMIT" ] +do + if `curl --fail -L $REPO_URL > $WORKSPACE/shaman.repo`; then + echo "Ceph repo file has been added from shaman" + REPO_FOUND=1 + break + else + sleep $INTERVAL + fi +done + +if [[ "$REPO_FOUND" -eq 0 ]]; then + echo "Ceph lib repo does NOT exist in shaman" exit 1 fi diff --git a/nfs-ganesha/config/definitions/nfs-ganesha.yml b/nfs-ganesha/config/definitions/nfs-ganesha.yml index 6a314a95..aaa6ada1 100644 --- a/nfs-ganesha/config/definitions/nfs-ganesha.yml +++ b/nfs-ganesha/config/definitions/nfs-ganesha.yml @@ -111,21 +111,6 @@ If this is checked, then the binaries will be built and pushed to chacra even if - ARCHS triggers: - github - - pollurl: - cron: '*/30 * * * *' - urls: - - url: https://shaman.ceph.com/api/repos/ceph/master/latest/centos/7/repo - check-content: - - simple: true - - url: https://shaman.ceph.com/api/repos/ceph/kraken/latest/centos/7/repo - check-content: - - simple: true - - url: https://shaman.ceph.com/api/repos/ceph/master/latest/ubuntu/xenial/repo - check-content: - - simple: true - - url: https://shaman.ceph.com/api/repos/ceph/kraken/latest/ubuntu/xenial/repo - check-content: - - simple: true scm: - nfs-ganesha -- 2.39.5