Show More
@@ -1,29 +1,35 b'' | |||||
1 | #!/bin/bash -e |
|
1 | #!/bin/bash -e | |
2 |
|
2 | |||
3 | BUILDDIR=$(dirname $0) |
|
3 | BUILDDIR=$(dirname $0) | |
4 | ROOTDIR=$(cd $BUILDDIR/..; pwd) |
|
4 | ROOTDIR=$(cd $BUILDDIR/..; pwd) | |
5 |
|
5 | |||
6 | if which docker.io >> /dev/null 2>&1 ; then |
|
6 | if which docker.io >> /dev/null 2>&1 ; then | |
7 | DOCKER=docker.io |
|
7 | DOCKER=docker.io | |
8 | elif which docker >> /dev/null 2>&1 ; then |
|
8 | elif which docker >> /dev/null 2>&1 ; then | |
9 | DOCKER=docker |
|
9 | DOCKER=docker | |
10 | else |
|
10 | else | |
11 | echo "Error: docker must be installed" |
|
11 | echo "Error: docker must be installed" | |
12 | exit 1 |
|
12 | exit 1 | |
13 | fi |
|
13 | fi | |
14 |
|
14 | |||
15 | $DOCKER -h 2> /dev/null | grep -q Jansens && { echo "Error: $DOCKER is the Docking System Tray - install docker.io instead"; exit 1; } |
|
15 | $DOCKER -h 2> /dev/null | grep -q Jansens && { echo "Error: $DOCKER is the Docking System Tray - install docker.io instead"; exit 1; } | |
16 | $DOCKER version | grep -q "^Client version:" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; } |
|
16 | $DOCKER version | grep -q "^Client version:" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; } | |
17 | $DOCKER version | grep -q "^Server version:" || { echo "Error: could not get docker server version - check it is running and your permissions"; exit 1; } |
|
17 | $DOCKER version | grep -q "^Server version:" || { echo "Error: could not get docker server version - check it is running and your permissions"; exit 1; } | |
18 |
|
18 | |||
19 | PLATFORM="$1" |
|
19 | PLATFORM="$1" | |
20 | [ "$PLATFORM" ] || { echo "Error: platform name must be specified"; exit 1; } |
|
20 | [ "$PLATFORM" ] || { echo "Error: platform name must be specified"; exit 1; } | |
21 |
|
21 | |||
22 | DFILE="$ROOTDIR/contrib/docker/$PLATFORM" |
|
22 | DFILE="$ROOTDIR/contrib/docker/$PLATFORM" | |
23 | [ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; } |
|
23 | [ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; } | |
24 |
|
24 | |||
25 | CONTAINER="hg-dockerrpm-$PLATFORM" |
|
25 | CONTAINER="hg-dockerrpm-$PLATFORM" | |
26 |
|
26 | |||
27 | $DOCKER build --tag $CONTAINER - < $DFILE |
|
27 | DBUILDUSER=build | |
28 | $DOCKER run --rm -v $ROOTDIR:/hg $CONTAINER bash -c \ |
|
28 | ( | |
|
29 | cat $DFILE | |||
|
30 | echo RUN groupadd $DBUILDUSER -g `id -g` | |||
|
31 | echo RUN useradd $DBUILDUSER -u `id -u` -g $DBUILDUSER | |||
|
32 | ) | $DOCKER build --tag $CONTAINER - | |||
|
33 | ||||
|
34 | $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR:/hg $CONTAINER bash -c \ | |||
29 | "cp -a hg hg-build; cd hg-build; make clean local $PLATFORM; cp packages/$PLATFORM/* /hg/packages/$PLATFORM/" |
|
35 | "cp -a hg hg-build; cd hg-build; make clean local $PLATFORM; cp packages/$PLATFORM/* /hg/packages/$PLATFORM/" |
General Comments 0
You need to be logged in to leave comments.
Login now