##// END OF EJS Templates
packaging: add `HG_DOCKER_OWN_USER` to `dockerdeb` like exists in `dockerrpm`...
Matt Harbison -
r46580:f6a1540d default
parent child Browse files
Show More
@@ -1,40 +1,44 b''
1 1 #!/bin/bash -eu
2 2
3 3 . $(dirname $0)/packagelib.sh
4 4
5 5 BUILDDIR=$(dirname $0)
6 6 export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd)
7 7
8 8 DISTID="$1"
9 9 CODENAME="$2"
10 10 PLATFORM="$1-$2"
11 11 shift; shift # extra params are passed to build process
12 12
13 13 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
14 14 CONTAINER=hg-docker-$PLATFORM
15 15
16 16 DOCKER=$($BUILDDIR/hg-docker docker-path)
17 17
18 18 $BUILDDIR/hg-docker build \
19 19 --build-arg CODENAME=$CODENAME \
20 20 $BUILDDIR/docker/$DISTID.template \
21 21 $CONTAINER
22 22
23 23 # debuild only appears to be able to save built debs etc to .., so we
24 24 # have to share the .. of the current directory with the docker
25 25 # container and hope it's writable. Whee.
26 26 dn=$(basename $ROOTDIR)
27 27
28 DBUILDUSER=build
28 if [[ -z "${HG_DOCKER_OWN_USER:-}" ]]; then
29 DBUILDUSER=build
30 else
31 DBUILDUSER="$(id -u):$(id -g)"
32 fi
29 33
30 34 if [ $(uname) = "Darwin" ] ; then
31 35 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
32 36 sh -c "cd /mnt/$dn && make clean && make local"
33 37 fi
34 38 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
35 39 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
36 40 (cd $ROOTDIR && contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME)
37 41 if [ $(uname) = "Darwin" ] ; then
38 42 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
39 43 sh -c "cd /mnt/$dn && make clean"
40 44 fi
General Comments 0
You need to be logged in to leave comments. Login now