4 # clear out any $@ potentially passed in
7 DISTS=`cat ../../dists`
8 RPM_VERSION=`git describe --always | cut -c2- | cut -d- -f1`
9 RPM_RELEASE=`if expr index $(git describe --always) '-' > /dev/null ; then git describe --always | cut -d- -f2- | tr '-' '.' ; else echo "0"; fi`
11 VER=${RPM_VERSION}-${RPM_RELEASE}
13 # Build packages and sign repo
14 export GNUPGHOME="/srv/gnupg"
15 ./scripts/build-rpm.sh || exit 3
17 REV="$(git rev-parse HEAD)"
18 OUTDIR="../out/output/sha1/$REV"
19 OUTDIR_TMP="${OUTDIR}.tmp"
20 install -d -m0755 -- "$OUTDIR_TMP"
21 printf '%s\n' "$REV" >"$OUTDIR_TMP/sha1"
22 printf '%s\n' "$VER" >"$OUTDIR_TMP/version"
23 printf '%s\n' "ceph-deploy" >"$OUTDIR_TMP/name"
25 cp -a rpm-repo/*/SRPMS $OUTDIR_TMP
26 cp -a rpm-repo/*/RPMS/* $OUTDIR_TMP
28 # we're successful, the files are ok to be published; try to be as
29 # atomic as possible about replacing potentially existing OUTDIR
30 if [ -e "$OUTDIR" ]; then
31 rm -rf -- "$OUTDIR.old"
32 mv -- "$OUTDIR" "$OUTDIR.old"
34 mv -- "$OUTDIR_TMP" "$OUTDIR"
35 rm -rf -- "$OUTDIR.old"