Patchwork [05,of,10,v2] dockerrpm: better handling of specification of docker name

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

Comments

Mads Kiilerich - Aug. 31, 2014, 11:41 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1401452073 -7200
#      Fri May 30 14:14:33 2014 +0200
# Node ID ad706c5fef1b103c6b37851d2b02f70d0f19fbda
# Parent  687930a9b382b71a9aa005ab90caf3338b300866
dockerrpm: better handling of specification of docker name

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -16,6 +16,14 @@  fi
 $DOCKER version | grep -q "^Client version:" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; }
 $DOCKER version | grep -q "^Server version:" || { echo "Error: could not get docker server version - check it is running and your permissions"; exit 1; }
 
-$DOCKER build --tag "hg-dockerrpm-$1" - < $BUILDDIR/docker/$1
-$DOCKER run --rm -v $ROOTDIR:/hg "hg-dockerrpm-$1" bash -c \
-    "cp -a hg hg-build; cd hg-build; make clean local $1; cp packages/$1/* /hg/packages/$1/"
+PLATFORM="$1"
+[ "$PLATFORM" ] || { echo "Error: platform name must be specified"; exit 1; }
+
+DFILE="$ROOTDIR/contrib/docker/$PLATFORM"
+[ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; }
+
+CONTAINER="hg-dockerrpm-$PLATFORM"
+
+$DOCKER build --tag $CONTAINER - < $DFILE
+$DOCKER run --rm -v $ROOTDIR:/hg $CONTAINER bash -c \
+    "cp -a hg hg-build; cd hg-build; make clean local $PLATFORM; cp packages/$PLATFORM/* /hg/packages/$PLATFORM/"