]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
sign_and_index_rpm_repo.sh: New script
authorGary Lowell <gary.lowell@inktank.com>
Wed, 29 May 2013 04:25:20 +0000 (21:25 -0700)
committerGary Lowell <gary.lowell@inktank.com>
Wed, 29 May 2013 04:25:20 +0000 (21:25 -0700)
This is the last script to run against the rpm repo after any
extra packages are added.  It signs all the rpms in the repo,
then builds an index using creatrepo for the top level directories
such as noarch and x86_64.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
sign_and_index_rpm_repo.sh [new file with mode: 0755]

diff --git a/sign_and_index_rpm_repo.sh b/sign_and_index_rpm_repo.sh
new file mode 100755 (executable)
index 0000000..45b2b6a
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+set -e
+
+releasedir=$1
+repo=$2
+cephvers=$3
+
+keyid=17ED316D
+
+usage() {
+    echo "usage: $0 releasedir repodir version"
+}
+
+[ -z "$releasedir" ] && echo specify releasedir && usage && exit 1
+[ -z "$repo" ] && echo specify reprepro dir && usage && exit 1
+[ -z "$cephvers" ] && echo specify version && usage && exit 1
+[ ! -d "$releasedir/$cephvers" ] && echo missing $releasedir/$cephvers && usage && exit 1
+
+bindir=`dirname $0`
+
+echo version $cephvers
+
+#
+#  Sign rpms and create repo index
+
+#echo "signing rpms"
+$bindir/sign_rpms.sh $repo $cephvers $keyid
+
+# Construct repodata
+#  repo/dist/*
+#for dir in $repo/*/*
+for dir in $repo/$cephvers/*/*
+do
+    echo "indexing $dir"
+    if [ -d $dir ] ; then
+        createrepo $dir
+        gpg --detach-sign --armor -u $keyid $dir/repodata/repomd.xml
+    fi
+done
+
+echo done