# Loop through the projects and build RPMs
# Some of this might not need to be repeated 3 times
+REPO_MAJOR_VERSION=0
for project in $(ls -h | grep -v dist); do
PROJECT=$project
cd $WORKSPACE/$PROJECT
-
+
# Get some basic information about the system and the repository
RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
VERSION="$(git describe --abbrev=0 --tags HEAD)" # for ceph-iscsi, this will return the major version number (e.g., 2)
+ MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f1)
+ if [ $MAJOR_VERSION -gt $REPO_MAJOR_VERSION ] ; then
+ REPO_MAJOR_VERSION=$MAJOR_VERSION
+ fi
REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
-
+
# Create dummy dist tar
tar cf ../dist/${PROJECT}-${VERSION}.tar.gz \
--exclude .git --exclude dist \
--transform "s,^,${PROJECT}-${VERSION}/," *
tar tfv ../dist/${PROJECT}-${VERSION}.tar.gz
-
+
# Update spec version
sed -i "s/^Version:.*$/Version:\t${VERSION}/g" $WORKSPACE/$PROJECT/${PROJECT}.spec
sed -i "s/^Release:.*$/Release:\t${REVISION}%{?dist}/g" $WORKSPACE/$PROJECT/${PROJECT}.spec
# for debugging
cat $WORKSPACE/$PROJECT/${PROJECT}.spec
-
+
# Update setup.py version
sed -i "s/version=\"[^\"]*\"/version=\"${VERSION}\"/g" $WORKSPACE/$PROJECT/setup.py
# for debugging
cat $WORKSPACE/$PROJECT/setup.py
-
+
# Create the source rpm
echo "Building SRPM"
rpmbuild \
--define "_rpmdir $WORKSPACE/dist/RPMS" \
--nodeps -bs $WORKSPACE/$PROJECT/${PROJECT}.spec
SRPM=$(readlink -f $WORKSPACE/dist/SRPMS/*.src.rpm)
-
+
# Build the binaries with mock
echo "Building RPMs"
sudo mock --verbose -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --scrub=all
cd $WORKSPACE
-# All three projects should share the same major version so we'll use that
-VERSION=$(echo $VERSION | cut -d '.' -f1)
-# The VERSION and GIT_COMMIT aren't really important here. We just feed it the last project's info so the CI works.
-chacra_endpoint="ceph-iscsi/${VERSION}/${GIT_COMMIT}/${DISTRO}/${RELEASE}"
+# The REPO_MAJOR_VERSION and GIT_COMMIT aren't really important here. We just feed it the last project's info so the CI works.
+chacra_endpoint="ceph-iscsi/${REPO_MAJOR_VERSION}/${GIT_COMMIT}/${DISTRO}/${RELEASE}"
chacra_repo_endpoint="${chacra_endpoint}/flavors/default"
# check to make sure ceph-iscsi-config package built
-if [ ! -f $WORKSPACE/dist/RPMS/ceph-iscsi-config-*.rpm ]; then
- echo "ceph-iscsi-config rpm not built!"
- exit 1
-fi
-
-# check to make sure ceph-iscsi-cli package built
-if [ ! -f $WORKSPACE/dist/RPMS/ceph-iscsi-cli-*.rpm ]; then
- echo "ceph-iscsi-cli rpm not built!"
+if [ ! -f $WORKSPACE/dist/RPMS/ceph-iscsi-*.rpm ]; then
+ echo "ceph-iscsi rpm not built!"
exit 1
fi
- scm:
- name: ceph-iscsi-config
+ name: ceph-iscsi
scm:
- git:
- url: https://github.com/ceph/ceph-iscsi-config.git
+ url: https://github.com/ceph/ceph-iscsi.git
branches:
- - $CEPH_ISCSI_CONFIG_BRANCH
+ - $CEPH_ISCSI_BRANCH
skip-tag: true
wipe-workspace: true
- basedir: "ceph-iscsi-config"
-
-- scm:
- name: ceph-iscsi-cli
- scm:
- - git:
- url: https://github.com/ceph/ceph-iscsi-cli.git
- branches:
- - $CEPH_ISCSI_CLI_BRANCH
- skip-tag: true
- wipe-workspace: true
- basedir: "ceph-iscsi-cli"
+ basedir: "ceph-iscsi"
- scm:
name: ceph-iscsi-tools
concurrent: true
parameters:
- string:
- name: CEPH_ISCSI_CONFIG_BRANCH
- description: "The git branch (or tag) to build"
- default: "2.6"
-
- - string:
- name: CEPH_ISCSI_CLI_BRANCH
+ name: CEPH_ISCSI_BRANCH
description: "The git branch (or tag) to build"
- default: "2.7"
+ default: "3.2"
- string:
name: CEPH_ISCSI_TOOLS_BRANCH
default: "/tmp/"
scm:
- - ceph-iscsi-config
- - ceph-iscsi-cli
+ - ceph-iscsi
- ceph-iscsi-tools
builders: