]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
diamond: Redesign + fixes 463/head
authorBoris Ranto <branto@redhat.com>
Mon, 5 Sep 2016 11:44:00 +0000 (13:44 +0200)
committerBoris Ranto <branto@redhat.com>
Mon, 5 Sep 2016 11:48:14 +0000 (13:48 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
diamond-build/build/build_rpm
diamond-build/build/setup
diamond-build/config/definitions/diamond-build.yml
diamond-setup/build/build

index 2c60f35f4c50cd37f0e22807f2b3e17911d8fa24..423c90739bddb6cc06a810d3039e5c0fa90afe7a 100644 (file)
@@ -57,12 +57,8 @@ dist=$DIST
 [ -z "$dist" ] && echo no dist && exit 1
 echo dist $dist
 
-vers=$(./version.sh)
-chacra_ref="$BRANCH"
-
-chacra_endpoint="diamond/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}"
-chacra_check_url="${chacra_endpoint}/${ARCH}/diamond-${vers}-0.${DIST}.${ARCH}.rpm"
-
+chacra_endpoint="diamond/${BRANCH}/${SHA1}/${DISTRO}/${RELEASE}"
+chacra_check_url="${chacra_endpoint}/${ARCH}/diamond-${VERSION}-0.${DIST}.${ARCH}.rpm"
 
 if [ "$THROWAWAY" = false ] ; then
     # this exists in scripts/build_utils.sh
@@ -80,30 +76,27 @@ echo "*****"
 env
 echo "*****"
 
-# Create the spec file and install the dependencies
-sed -e "s/@VERSION@/${vers}/g" < diamond.spec.in > diamond.spec
-yum-builddep -y diamond.spec
+# Install the dependencies
+sudo yum-builddep -y dist/diamond.spec
 
 # Create the source rpm
 echo "Building SRPM"
-rpmbuild \ 
-       --define "_sourcedir $PWD/dist" \
-       --define "_specdir $PWD" \
-       --define "_builddir $PWD" \
-       --define "_srcrpmdir $PWD" \
-       --define "_rpmdir $PWD" \
+rpmbuild \
+       --define "_sourcedir ./dist" \
+       --define "_specdir ." \
+       --define "_builddir ." \
+       --define "_srcrpmdir ." \
+       --define "_rpmdir ." \
        --define "dist .any" \
        --define "fedora 21" \
        --define "rhel 7" \
-       --nodeps -bs diamond.spec
+       --nodeps -bs dist/diamond.spec
 SRPM=$(readlink -f *.src.rpm)
 
-
 # Build the binaries
 echo "Building RPMs"
 sudo mock -r epel-${RELEASE}-${ARCH} --resultdir=./dist/rpm/"%(dist)s"/"%(target_arch)s"/ ${SRPM}
 
-
 # Make sure we execute at the top level directory
 cd "$WORKSPACE"
 
index a56e5b8bc34e2704417e9793330f01ecb1041eea..bccd321c0a0a6dfef44e854ffea68bb8fa95bb45 100644 (file)
@@ -47,7 +47,6 @@ CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
                 $SUDO yum install -y yum-utils mock
                 ;;
         esac
-       _vers=$(./version.sh)
         ;;
 *)
         echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually."
index 057ea078c8c5f5d69c878bb5d67c7b2c1c10bd02..05eed80983a8b8d67e6968e1a6fab47f6d2dcebf 100644 (file)
@@ -16,7 +16,7 @@
           type: label-expression
           name: MACHINE_SIZE
           values:
-            - huge
+            - small
       - axis:
           type: label-expression
           name: AVAILABLE_ARCH
           which-build: last-successful
       - inject:
           properties-file: ${WORKSPACE}/dist/sha1
+      - inject:
+          properties-file: ${WORKSPACE}/dist/branch
+      - inject:
+          properties-file: ${WORKSPACE}/dist/version
       # rpm build scripts
       - shell:
           !include-raw:
index 1dc903a0c14f946b340808833b9cdd1926076f94..daf443320d3f9934bb6de4d928e649859f6af7fe 100644 (file)
@@ -16,15 +16,35 @@ fi
 
 echo "Building version $(git describe) Branch $BRANCH"
 
+# Make sure the dist directory is clean
 rm -rf dist
+mkdir -p dist
 
+# Install any setup-time deps
 if [ -x install-deps.sh ]; then
   echo "Ensuring dependencies are installed"
   ./install-deps.sh
 fi
 
+# Make sure the repo is clean
 echo "Cleaning up the repo"
 git clean -fxd
 
 echo "Building source distribution"
 python setup.py sdist
+
+# Prepare the spec file for build
+sed -e "s/@VERSION@/${vers}/g" < diamond.spec.in > dist/diamond.spec
+
+# Save these so that we can later inject them into the build script
+cat > dist/sha1 << EOF
+SHA1=${GIT_COMMIT}
+EOF
+
+cat > dist/branch << EOF
+BRANCH=${BRANCH}
+EOF
+
+cat > dist/version << EOF
+VERSION=$(./version.sh)
+EOF