Show More
@@ -1,60 +1,55 b'' | |||
|
1 | 1 | #!/bin/bash -e |
|
2 | 2 | |
|
3 | 3 | BUILDDIR=$(dirname $0) |
|
4 | 4 | export ROOTDIR=$(cd $BUILDDIR/../..; pwd) |
|
5 | 5 | |
|
6 | 6 | PLATFORM="$1" |
|
7 | 7 | shift # extra params are passed to buildrpm |
|
8 | 8 | |
|
9 | 9 | DOCKERFILE="$PLATFORM" |
|
10 | 10 | OS_RELEASE="${PLATFORM//[a-z]/}" |
|
11 | 11 | case "$PLATFORM" in |
|
12 | 12 | fedora*) |
|
13 | 13 | DOCKERFILE="${PLATFORM//[0-9]/}.template" |
|
14 | 14 | ;; |
|
15 | 15 | esac |
|
16 | 16 | |
|
17 | 17 | DOCKER=$($BUILDDIR/hg-docker docker-path) |
|
18 | 18 | |
|
19 | 19 | CONTAINER=hg-docker-$PLATFORM |
|
20 | 20 | |
|
21 | if [[ -z "${HG_DOCKER_OWN_USER}" ]]; then | |
|
22 | DOCKERUID=1000 | |
|
23 | DOCKERGID=1000 | |
|
24 | else | |
|
25 | DOCKERUID=$(id -u) | |
|
26 | DOCKERGID=$(id -g) | |
|
27 | fi | |
|
21 | DOCKERUID=$(id -u) | |
|
22 | DOCKERGID=$(id -g) | |
|
28 | 23 | |
|
29 | 24 | $BUILDDIR/hg-docker build \ |
|
30 | 25 | --build-arg UID=$DOCKERUID \ |
|
31 | 26 | --build-arg GID=$DOCKERGID \ |
|
32 | 27 | --build-arg OS_RELEASE=${OS_RELEASE:-latest} \ |
|
33 | 28 | $BUILDDIR/docker/$DOCKERFILE $CONTAINER |
|
34 | 29 | |
|
35 | 30 | RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM |
|
36 | 31 | mkdir -p $RPMBUILDDIR |
|
37 | 32 | $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $* |
|
38 | 33 | |
|
39 | 34 | DSHARED=/mnt/shared |
|
40 | 35 | DBUILDUSER=build |
|
41 | 36 | |
|
42 | 37 | $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \ |
|
43 | 38 | rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean |
|
44 | 39 | |
|
45 | 40 | $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \ |
|
46 | 41 | createrepo $DSHARED |
|
47 | 42 | |
|
48 | 43 | cat << EOF > $RPMBUILDDIR/mercurial.repo |
|
49 | 44 | # Place this file in /etc/yum.repos.d/mercurial.repo |
|
50 | 45 | [mercurial] |
|
51 | 46 | name=Mercurial packages for $PLATFORM |
|
52 | 47 | # baseurl=file://$RPMBUILDDIR/ |
|
53 | 48 | baseurl=http://hg.example.com/build/$PLATFORM/ |
|
54 | 49 | skip_if_unavailable=True |
|
55 | 50 | gpgcheck=0 |
|
56 | 51 | enabled=1 |
|
57 | 52 | EOF |
|
58 | 53 | |
|
59 | 54 | echo |
|
60 | 55 | echo "Build complete - results can be found in $RPMBUILDDIR" |
General Comments 0
You need to be logged in to leave comments.
Login now