--- /dev/null
+#!/bin/bash
+set -ex
+
+# create a release directory for ceph-build tools
+raw_version=`echo $vers | cut -d '-' -f 1`
+
+RELEASE_BRANCH=$(release_from_version $raw_version)
+case $RELEASE_BRANCH in
+nautilus|octopus)
+ OBSREPO="openSUSE_Leap_15.1"
+ ;;
+mimic)
+ OBSREPO="openSUSE_Leap_15.0"
+ ;;
+luminous)
+ OBSREPO="openSUSE_Leap_42.3"
+ ;;
+*)
+ echo Not supported release '$RELEASE_BRANCH' by openSUSE
+ exit 1
+ ;;
+esac
+
+OBSPROJ="filesystems:ceph:$RELEASE_BRANCH:upstream"
+OBSARCH="x86_64"
+BUILDHOME=/var/tmp/build-root/$OBSREPO-$OBSARCH/home/abuild
+
+rm -rf $OBSPROJ
+osc co $OBSPROJ
+
+rm $OBSPROJ/ceph/ceph-*.tar.bz2
+rm $OBSPROJ/ceph/ceph.spec
+
+cp -a dist/ceph-*.tar.bz2 $OBSPROJ/ceph/.
+cp -a dist/ceph.spec $OBSPROJ/ceph/.
+cp -a dist/rpm/*.patch $OBSPROJ/ceph/. || true
+
+echo "Building RPMs"
+
+(
+ cd $OBSPROJ/ceph
+ osc build --trust-all-projects --clean $OBSREPO $OBSARCH
+)
+
+
+RPM_RELEASE=$(grep Release $OBSPROJ/ceph/ceph.spec | sed 's/Release:[ \t]*//g' | cut -d '%' -f 1)
+RPM_VERSION=$(grep Version $OBSPROJ/ceph/ceph.spec | sed 's/Version:[ \t]*//g')
+PACKAGE_MANAGER_VERSION="$RPM_VERSION-$RPM_RELEASE"
+
+
+chacra_binary="$VENV/chacractl binary"
+[ "$FORCE" = true ] && chacra_binary="$chacra_binary --force"
+
+chacra_create="$chacra_binary create"
+if [ "$THROWAWAY" = false ] ; then
+ # push binaries to chacra
+ find $BUILDHOME/rpmbuild/SRPMS | grep "\.rpm$" |
+ $chacra_create ${chacra_endpoint}/source/flavors/${FLAVOR}
+ find $BUILDHOME/rpmbuild/RPMS | grep "\.rpm$" |
+ $chacra_create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}
+ # write json file with build info
+ cat > $WORKSPACE/repo-extra.json << EOF
+{
+ "version":"$vers",
+ "package_manager_version":"$PACKAGE_MANAGER_VERSION",
+ "build_url":"$BUILD_URL",
+ "root_build_cause":"$ROOT_BUILD_CAUSE",
+ "node_name":"$NODE_NAME",
+ "job_name":"$JOB_NAME"
+}
+EOF
+ chacra_repo_endpoint="${chacra_endpoint}/flavors/${FLAVOR}"
+ # post the json to repo-extra json to chacra
+ curl -X POST -H "Content-Type:application/json" --data "@$WORKSPACE/repo-extra.json" -u $CHACRACTL_USER:$CHACRACTL_KEY ${chacra_url}repos/${chacra_repo_endpoint}/extra/
+ # start repo creation
+ $VENV/chacractl repo update ${chacra_repo_endpoint}
+
+ echo Check the status of the repo at: https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/
+fi
+
+# update shaman with the completed build status
+update_build_status "completed" "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
--- /dev/null
+#!/bin/bash
+
+set -ex
+HOST=$(hostname --short)
+echo "Building on $(hostname)"
+echo " DIST=${DIST}"
+echo " BPTAG=${BPTAG}"
+echo " KEYID=${KEYID}"
+echo " WS=$WORKSPACE"
+echo " PWD=$(pwd)"
+echo " BUILD SOURCE=$COPYARTIFACT_BUILD_NUMBER_CEPH_SETUP"
+echo "*****"
+env
+echo "*****"
+
+#DIR=/tmp/install-deps.$$
+#trap "rm -fr $DIR" EXIT
+#mkdir -p $DIR
+if test $(id -u) != 0 ; then
+ SUDO=sudo
+fi
+export LC_ALL=C # the following is vulnerable to i18n
+
+cd dist
+ORIGTAR=(*.orig.tar.gz)
+ORIGDIR=${ORIGTAR%.orig.tar.gz}
+ORIGDIR=${ORIGDIR//_/-}
+tar xzf $ORIGTAR
+cd $ORIGDIR
+pwd
+
+# do not need this on opensuse
+#maybe_downgrade_gcc
+
+BRANCH=`branch_slash_filter $BRANCH`
+
+cd $WORKSPACE
+
+get_rpm_dist() {
+ LSB_RELEASE=/usr/bin/lsb_release
+ [ ! -x $LSB_RELEASE ] && echo unknown && exit
+
+ ID=`$LSB_RELEASE --short --id`
+
+ case $ID in
+ RedHatEnterpriseServer)
+ RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
+ DIST=rhel$RELEASE
+ DISTRO=rhel
+ ;;
+ CentOS)
+ RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
+ DIST=el$RELEASE
+ DISTRO=centos
+ ;;
+ Fedora)
+ RELEASE=`$LSB_RELEASE --short --release`
+ DIST=fc$RELEASE
+ DISTRO=fedora
+ ;;
+ SUSE\ LINUX|openSUSE)
+ DESC=`$LSB_RELEASE --short --description`
+ RELEASE=`$LSB_RELEASE --short --release`
+ case $DESC in
+ *openSUSE*)
+ DIST=leap${RELEASE%%.*}
+ DISTRO=opensuse
+ ;;
+ *Enterprise*)
+ DIST=sles$RELEASE
+ DISTRO=sles
+ ;;
+ esac
+ ;;
+ *)
+ DIST=unknown
+ DISTRO=unknown
+ ;;
+ esac
+
+ echo $DIST
+}
+
+get_rpm_dist
+
+# Normalize variables across rpm/deb builds
+NORMAL_DISTRO=$DISTRO
+NORMAL_DISTRO_VERSION=$RELEASE
+NORMAL_ARCH=$ARCH
+
+# create build status in shaman
+create_build_status "started" "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
+
+pkgs=( "chacractl>=0.0.4" )
+install_python_packages "pkgs[@]"
+
+# ask shaman which chacra instance to use
+chacra_url=`curl -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/`
+# create the .chacractl config file using global variables
+make_chacractl_config $chacra_url
+
+dist=$DIST
+[ -z "$dist" ] && echo no dist && exit 1
+echo dist $dist
+
+vers=`cat ./dist/version`
+chacra_ref="$BRANCH"
+
+chacra_endpoint="ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}"
+chacra_check_url="${chacra_endpoint}/${ARCH}/flavors/${FLAVOR}/librados2-${vers}-0.${DIST}.${ARCH}.rpm"
+
+
+if [ "$THROWAWAY" = false ] ; then
+ # this exists in scripts/build_utils.sh
+ # TODO if this exits we need to post to shaman a success
+ check_binary_existence $chacra_check_url
+fi
--- /dev/null
+#!/bin/bash
+set -ex
+
+# only do work if we are a SUSE distro
+( source /etc/os-release
+ case $ID in
+ opensuse*|suse|sles)
+ exit 0
+ ;;
+ *)
+ exit 1
+ ;;
+ esac) || exit 0
--- /dev/null
+../../ceph-dev-build/build/build_osc
\ No newline at end of file
--- /dev/null
+../../ceph-dev-build/build/setup_osc
\ No newline at end of file
--- /dev/null
+../../ceph-dev-build/build/validate_osc
\ No newline at end of file