Patchwork [10,of,10,v2] dockerrpm: create a yum/dnf repo from the generated rpms

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 31, 2014, 11:41 a.m.
Message ID <99662a84ba38bbf71785.1409485300@localhost.localdomain>
Download mbox | patch
Permalink /patch/5665/
State Accepted
Headers show

Comments

Mads Kiilerich - Aug. 31, 2014, 11:41 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1409485269 -7200
#      Sun Aug 31 13:41:09 2014 +0200
# Node ID 99662a84ba38bbf71785304f17805d9791c43110
# Parent  f092f5ea6a405d1af342f605ff13e9357d81d6ca
dockerrpm: create a yum/dnf repo from the generated rpms

This gives "PPA" functionality where users easily can stay uptodate with latest
nightly build.
Matt Mackall - Sept. 16, 2014, 4:28 p.m.
On Sun, 2014-08-31 at 13:41 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1409485269 -7200
> #      Sun Aug 31 13:41:09 2014 +0200
> # Node ID 99662a84ba38bbf71785304f17805d9791c43110
> # Parent  f092f5ea6a405d1af342f605ff13e9357d81d6ca
> dockerrpm: create a yum/dnf repo from the generated rpms
> 
> This gives "PPA" functionality where users easily can stay uptodate with latest
> nightly build.

These are queued for default, thanks.

Patch

diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
--- a/contrib/docker/centos5
+++ b/contrib/docker/centos5
@@ -1,4 +1,6 @@ 
 FROM saltstack/centos-5-minimal
 RUN yum install -y gcc make rpm-build gettext tar
 RUN yum install -y python-devel python-docutils
+# For creating repo meta data
+RUN yum install -y createrepo
 RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
--- a/contrib/docker/centos6
+++ b/contrib/docker/centos6
@@ -5,3 +5,5 @@  RUN yum install -y make
 RUN yum install -y rpm-build
 RUN yum install -y gettext
 RUN yum install -y tar
+# For creating repo meta data
+RUN yum install -y createrepo
diff --git a/contrib/docker/fedora20 b/contrib/docker/fedora20
--- a/contrib/docker/fedora20
+++ b/contrib/docker/fedora20
@@ -4,3 +4,5 @@  RUN yum install -y python-devel python-d
 RUN yum install -y make
 RUN yum install -y rpm-build
 RUN yum install -y gettext
+# For creating repo meta data
+RUN yum install -y createrepo
diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -38,3 +38,20 @@  contrib/buildrpm --rpmbuilddir $RPMBUILD
 DSHARED=/mnt/shared
 $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
     rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean
+
+$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
+    createrepo $DSHARED
+
+cat << EOF > $RPMBUILDDIR/mercurial.repo
+# Place this file in /etc/yum.repos.d/mercurial.repo
+[mercurial]
+name=Mercurial packages for $NAME
+# baseurl=file://$RPMBUILDDIR/
+baseurl=http://hg.example.com/build/$NAME/
+skip_if_unavailable=True
+gpgcheck=0
+enabled=1
+EOF
+
+echo
+echo "Build complete - results can be found in $RPMBUILDDIR"