]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-deploy: push debian binaries to chacra
authorAndrew Schoen <aschoen@redhat.com>
Thu, 5 Nov 2015 20:57:48 +0000 (14:57 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 5 Nov 2015 21:49:05 +0000 (15:49 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-deploy/build/build

index 932db2715b8dd8091f075d3821eb357beb1c8ebd..3ea352464841fe96c0ebb18a22ef34f3f2c3e2fc 100644 (file)
@@ -96,6 +96,19 @@ then
     DEB_BUILD=$(lsb_release -s -c)
     #XXX only releases until we fix this
     RELEASE=1
+    DISTRO=`python -c "exec 'import platform; print platform.linux_distribution()[0].lower()'"`
+
+    [ "$TEST" = true ] && chacra_ref="test" || chacra_ref="$BRANCH"
+    chacra_endpoint="ceph/${chacra_ref}/${DISTRO}/${DEB_BUILD}/${ARCH}"
+
+    # prevent early exit from a non-zero exit because we use `set -e`
+    ! chacractl exists binaries/${chacra_endpoint} ; exists=$? || true
+
+    # if the binary already exists in chacra, do not rebuild
+    if [ $exists -eq 0 ] && [ "$FORCE" = false ] ; then
+        echo "The endpoint at ${chacra_endpoint} already exists and FORCE was not set, Exiting..."
+        exit 0
+    fi
 
     if [ ! -d debian ] ; then
         echo "Are we in the right directory"
@@ -124,40 +137,11 @@ then
         exit 2
     fi
 
-    # Build Repo
-    PKG=../ceph-deploy*.changes
-    mkdir -p $REPO/conf
-    if [ -e $REPO/conf/distributions ] ; then
-        rm -f $REPO/conf/distributions
-    fi
+    [ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""
+
+    # push binaries to chacra
+    find ../ | egrep "*\.(changes|deb|dsc|gz)$" | egrep -v "(Packages|Sources|Contents)" | chacractl binary ${chacra_flags} create ${chacra_endpoint}
 
-    # FIXME: This file is explicitly saying what it was signed with but we no longer
-    # sign anything here. This could become a problem if this repo is getting built
-    # and not signed and published somehwere. When the Binary API service is running
-    # and serving repos, this step should no longer create repositories
-    for DIST in  $DEB_DIST ; do
-        cat <<EOF >> $REPO/conf/distributions
-Codename: $DIST
-Suite: stable
-Components: $COMPONENT
-Architectures: amd64 armhf i386 source
-Origin: Inktank
-Description: Ceph distributed file system
-DebIndices: Packages Release . .gz .bz2
-DscIndices: Sources Release .gz .bz2
-Contents: .gz .bz2
-SignWith: 460F3994
-
-EOF
-    done
-
-    echo "Adding package to repo, dist: $DEB_BUILD ($PKG)"
-    reprepro --ask-passphrase -b $REPO -C $COMPONENT --ignore=undefinedtarget --ignore=wrongdistribution include $DEB_BUILD $PKG
-
-
-    cd $WORKSPACE
-    mkdir -p dist
-    mv ../*.changes ../*.dsc ../*.deb ../*.tar.gz dist/.
     echo "Done"
 
 else