##// END OF EJS Templates
packaging: don't write files for templatized Dockerfiles...
Gregory Szorc -
r38477:c8ef9d89 default
parent child Browse files
Show More
@@ -1,70 +1,68 b''
1 syntax: glob
1 syntax: glob
2
2
3 *.elc
3 *.elc
4 *.tmp
4 *.tmp
5 *.orig
5 *.orig
6 *.rej
6 *.rej
7 *~
7 *~
8 *.mergebackup
8 *.mergebackup
9 *.o
9 *.o
10 *.so
10 *.so
11 *.dll
11 *.dll
12 *.exe
12 *.exe
13 *.pyd
13 *.pyd
14 *.pyc
14 *.pyc
15 *.pyo
15 *.pyo
16 *$py.class
16 *$py.class
17 *.swp
17 *.swp
18 *.prof
18 *.prof
19 *.zip
19 *.zip
20 \#*\#
20 \#*\#
21 .\#*
21 .\#*
22 tests/.coverage*
22 tests/.coverage*
23 tests/.testtimes*
23 tests/.testtimes*
24 tests/.hypothesis
24 tests/.hypothesis
25 tests/hypothesis-generated
25 tests/hypothesis-generated
26 tests/annotated
26 tests/annotated
27 tests/exceptions
27 tests/exceptions
28 tests/*.err
28 tests/*.err
29 tests/htmlcov
29 tests/htmlcov
30 build
30 build
31 contrib/chg/chg
31 contrib/chg/chg
32 contrib/hgsh/hgsh
32 contrib/hgsh/hgsh
33 contrib/vagrant/.vagrant
33 contrib/vagrant/.vagrant
34 contrib/packaging/docker/debian-*
35 contrib/packaging/docker/ubuntu-*
36 dist
34 dist
37 packages
35 packages
38 doc/common.txt
36 doc/common.txt
39 doc/*.[0-9]
37 doc/*.[0-9]
40 doc/*.[0-9].txt
38 doc/*.[0-9].txt
41 doc/*.[0-9].gendoc.txt
39 doc/*.[0-9].gendoc.txt
42 doc/*.[0-9].{x,ht}ml
40 doc/*.[0-9].{x,ht}ml
43 MANIFEST
41 MANIFEST
44 MANIFEST.in
42 MANIFEST.in
45 patches
43 patches
46 mercurial/__modulepolicy__.py
44 mercurial/__modulepolicy__.py
47 mercurial/__version__.py
45 mercurial/__version__.py
48 mercurial/hgpythonlib.h
46 mercurial/hgpythonlib.h
49 mercurial.egg-info
47 mercurial.egg-info
50 .DS_Store
48 .DS_Store
51 tags
49 tags
52 cscope.*
50 cscope.*
53 .idea/*
51 .idea/*
54 .asv/*
52 .asv/*
55 i18n/hg.pot
53 i18n/hg.pot
56 locale/*/LC_MESSAGES/hg.mo
54 locale/*/LC_MESSAGES/hg.mo
57 hgext/__index__.py
55 hgext/__index__.py
58
56
59 rust/target/
57 rust/target/
60
58
61 # Generated wheels
59 # Generated wheels
62 wheelhouse/
60 wheelhouse/
63
61
64 syntax: regexp
62 syntax: regexp
65 ^\.pc/
63 ^\.pc/
66 ^\.(pydev)?project
64 ^\.(pydev)?project
67
65
68 # hackable windows distribution additions
66 # hackable windows distribution additions
69 ^hg-python
67 ^hg-python
70 ^hg.py$
68 ^hg.py$
@@ -1,167 +1,161 b''
1 $(eval HGROOT := $(shell cd ../..; pwd))
1 $(eval HGROOT := $(shell cd ../..; pwd))
2
2
3 help:
3 help:
4 @echo 'Packaging Make Targets'
4 @echo 'Packaging Make Targets'
5 @echo ''
5 @echo ''
6 @echo 'docker-centos-{5, 6, 7}'
6 @echo 'docker-centos-{5, 6, 7}'
7 @echo ' Build an RPM for a specific CentOS version using Docker.'
7 @echo ' Build an RPM for a specific CentOS version using Docker.'
8 @echo ''
8 @echo ''
9 @echo 'docker-debian-{jessie, stretch}'
9 @echo 'docker-debian-{jessie, stretch}'
10 @echo ' Build Debian packages specific to a Debian distro using Docker.'
10 @echo ' Build Debian packages specific to a Debian distro using Docker.'
11 @echo ''
11 @echo ''
12 @echo 'docker-fedora-{20, 21}'
12 @echo 'docker-fedora-{20, 21}'
13 @echo ' Build an RPM for a specific Fedora version using Docker.'
13 @echo ' Build an RPM for a specific Fedora version using Docker.'
14 @echo ''
14 @echo ''
15 @echo 'docker-ubuntu-{trusty, xenial, artful, bionic}'
15 @echo 'docker-ubuntu-{trusty, xenial, artful, bionic}'
16 @echo ' Build Debian package specific to an Ubuntu distro using Docker.'
16 @echo ' Build Debian package specific to an Ubuntu distro using Docker.'
17 @echo ''
17 @echo ''
18 @echo 'docker-ubuntu-{trusty, xenial, artful, bionic}-ppa'
18 @echo 'docker-ubuntu-{trusty, xenial, artful, bionic}-ppa'
19 @echo ' Build a source-only Debian package specific to an Ubuntu distro'
19 @echo ' Build a source-only Debian package specific to an Ubuntu distro'
20 @echo ' using Docker.'
20 @echo ' using Docker.'
21 @echo ''
21 @echo ''
22 @echo 'linux-wheels'
22 @echo 'linux-wheels'
23 @echo ' Build Linux manylinux wheels using Docker.'
23 @echo ' Build Linux manylinux wheels using Docker.'
24 @echo ''
24 @echo ''
25 @echo 'linux-wheels-{x86_64, i686}'
25 @echo 'linux-wheels-{x86_64, i686}'
26 @echo ' Build Linux manylinux wheels for a specific architecture using Docker'
26 @echo ' Build Linux manylinux wheels for a specific architecture using Docker'
27 @echo ''
27 @echo ''
28 @echo 'deb'
28 @echo 'deb'
29 @echo ' Build a Debian package locally targeting the current system'
29 @echo ' Build a Debian package locally targeting the current system'
30 @echo ''
30 @echo ''
31 @echo 'ppa'
31 @echo 'ppa'
32 @echo ' Build a Debian source package locally targeting the current system'
32 @echo ' Build a Debian source package locally targeting the current system'
33 @echo ''
33 @echo ''
34 @echo 'centos-{5, 6, 7}'
34 @echo 'centos-{5, 6, 7}'
35 @echo ' Build an RPM for a specific CentOS version locally'
35 @echo ' Build an RPM for a specific CentOS version locally'
36 @echo ''
36 @echo ''
37 @echo 'fedora-{20, 21}'
37 @echo 'fedora-{20, 21}'
38 @echo ' Build an RPM for a specific Fedora version locally'
38 @echo ' Build an RPM for a specific Fedora version locally'
39
39
40 .PHONY: help
40 .PHONY: help
41
41
42 .PHONY: deb
42 .PHONY: deb
43 deb:
43 deb:
44 ./builddeb
44 ./builddeb
45
45
46 .PHONY: ppa
46 .PHONY: ppa
47 ppa:
47 ppa:
48 ./builddeb --source-only
48 ./builddeb --source-only
49
49
50 docker/debian-%: docker/debian.template
51 sed "s/__CODENAME__/$*/" $< > $@
52
53 .PHONY: docker-debian-jessie
50 .PHONY: docker-debian-jessie
54 docker-debian-jessie: docker/debian-jessie
51 docker-debian-jessie:
55 ./dockerdeb debian jessie
52 ./dockerdeb debian jessie
56
53
57 .PHONY: docker-debian-stretch
54 .PHONY: docker-debian-stretch
58 docker-debian-stretch: docker/debian-stretch
55 docker-debian-stretch:
59 ./dockerdeb debian stretch
56 ./dockerdeb debian stretch
60
57
61 docker/ubuntu-%: docker/ubuntu.template
62 sed "s/__CODENAME__/$*/" $< > $@
63
64 .PHONY: docker-ubuntu-trusty
58 .PHONY: docker-ubuntu-trusty
65 docker-ubuntu-trusty: docker/ubuntu-trusty
59 docker-ubuntu-trusty:
66 ./dockerdeb ubuntu trusty
60 ./dockerdeb ubuntu trusty
67
61
68 .PHONY: docker-ubuntu-trusty-ppa
62 .PHONY: docker-ubuntu-trusty-ppa
69 docker-ubuntu-trusty-ppa: docker/ubuntu-trusty
63 docker-ubuntu-trusty-ppa:
70 ./dockerdeb ubuntu trusty --source-only
64 ./dockerdeb ubuntu trusty --source-only
71
65
72 .PHONY: docker-ubuntu-xenial
66 .PHONY: docker-ubuntu-xenial
73 docker-ubuntu-xenial: docker/ubuntu-xenial
67 docker-ubuntu-xenial:
74 ./dockerdeb ubuntu xenial
68 ./dockerdeb ubuntu xenial
75
69
76 .PHONY: docker-ubuntu-xenial-ppa
70 .PHONY: docker-ubuntu-xenial-ppa
77 docker-ubuntu-xenial-ppa: docker/ubuntu-xenial
71 docker-ubuntu-xenial-ppa:
78 ./dockerdeb ubuntu xenial --source-only
72 ./dockerdeb ubuntu xenial --source-only
79
73
80 .PHONY: docker-ubuntu-artful
74 .PHONY: docker-ubuntu-artful
81 docker-ubuntu-artful: docker/ubuntu-artful
75 docker-ubuntu-artful:
82 ./dockerdeb ubuntu artful
76 ./dockerdeb ubuntu artful
83
77
84 .PHONY: docker-ubuntu-artful-ppa
78 .PHONY: docker-ubuntu-artful-ppa
85 docker-ubuntu-artful-ppa: docker/ubuntu-artful
79 docker-ubuntu-artful-ppa:
86 ./dockerdeb ubuntu artful --source-only
80 ./dockerdeb ubuntu artful --source-only
87
81
88 .PHONY: docker-ubuntu-bionic
82 .PHONY: docker-ubuntu-bionic
89 docker-ubuntu-bionic: docker/ubuntu-bionic
83 docker-ubuntu-bionic:
90 ./dockerdeb ubuntu bionic
84 ./dockerdeb ubuntu bionic
91
85
92 .PHONY: docker-ubuntu-bionic-ppa
86 .PHONY: docker-ubuntu-bionic-ppa
93 docker-ubuntu-bionic-ppa: docker/ubuntu-bionic
87 docker-ubuntu-bionic-ppa:
94 ./dockerdeb ubuntu bionic --source-only
88 ./dockerdeb ubuntu bionic --source-only
95
89
96 .PHONY: fedora20
90 .PHONY: fedora20
97 fedora20:
91 fedora20:
98 mkdir -p $(HGROOT)/packages/fedora20
92 mkdir -p $(HGROOT)/packages/fedora20
99 ./buildrpm
93 ./buildrpm
100 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora20
94 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora20
101 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora20
95 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora20
102 rm -rf $(HGROOT)/rpmbuild
96 rm -rf $(HGROOT)/rpmbuild
103
97
104 .PHONY: docker-fedora20
98 .PHONY: docker-fedora20
105 docker-fedora20:
99 docker-fedora20:
106 mkdir -p $(HGROOT)/packages/fedora20
100 mkdir -p $(HGROOT)/packages/fedora20
107 ./dockerrpm fedora20
101 ./dockerrpm fedora20
108
102
109 .PHONY: fedora21
103 .PHONY: fedora21
110 fedora21:
104 fedora21:
111 mkdir -p $(HGROOT)/packages/fedora21
105 mkdir -p $(HGROOT)/packages/fedora21
112 ./buildrpm
106 ./buildrpm
113 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora21
107 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora21
114 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora21
108 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora21
115 rm -rf $(HGROOT)/rpmbuild
109 rm -rf $(HGROOT)/rpmbuild
116
110
117 .PHONY: docker-fedora21
111 .PHONY: docker-fedora21
118 docker-fedora21:
112 docker-fedora21:
119 mkdir -p $(HGROOT)packages/fedora21
113 mkdir -p $(HGROOT)packages/fedora21
120 ./dockerrpm fedora21
114 ./dockerrpm fedora21
121
115
122 .PHONY: centos5
116 .PHONY: centos5
123 centos5:
117 centos5:
124 mkdir -p $(HGROOT)/packages/centos5
118 mkdir -p $(HGROOT)/packages/centos5
125 ./buildrpm --withpython
119 ./buildrpm --withpython
126 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos5
120 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos5
127 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos5
121 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos5
128
122
129 .PHONY: docker-centos5
123 .PHONY: docker-centos5
130 docker-centos5:
124 docker-centos5:
131 mkdir -p $(HGROOT)/packages/centos5
125 mkdir -p $(HGROOT)/packages/centos5
132 ./dockerrpm centos5 --withpython
126 ./dockerrpm centos5 --withpython
133
127
134 .PHONY: centos6
128 .PHONY: centos6
135 centos6:
129 centos6:
136 mkdir -p $(HGROOT)/packages/centos6
130 mkdir -p $(HGROOT)/packages/centos6
137 ./buildrpm --withpython
131 ./buildrpm --withpython
138 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos6
132 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos6
139 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos6
133 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos6
140
134
141 .PHONY: docker-centos6
135 .PHONY: docker-centos6
142 docker-centos6:
136 docker-centos6:
143 mkdir -p $(HGROOT)/packages/centos6
137 mkdir -p $(HGROOT)/packages/centos6
144 ./dockerrpm centos6 --withpython
138 ./dockerrpm centos6 --withpython
145
139
146 .PHONY: centos7
140 .PHONY: centos7
147 centos7:
141 centos7:
148 mkdir -p $(HGROOT)/packages/centos7
142 mkdir -p $(HGROOT)/packages/centos7
149 ./buildrpm
143 ./buildrpm
150 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos7
144 cp $(HGROOT)/rpmbuild/RPMS/*/* $(HGROOT)/packages/centos7
151 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos7
145 cp $(HGROOT)/rpmbuild/SRPMS/* $(HGROOT)/packages/centos7
152
146
153 .PHONY: docker-centos7
147 .PHONY: docker-centos7
154 docker-centos7:
148 docker-centos7:
155 mkdir -p $(HGROOT)/packages/centos7
149 mkdir -p $(HGROOT)/packages/centos7
156 ./dockerrpm centos7
150 ./dockerrpm centos7
157
151
158 .PHONY: linux-wheels
152 .PHONY: linux-wheels
159 linux-wheels: linux-wheels-x86_64 linux-wheels-i686
153 linux-wheels: linux-wheels-x86_64 linux-wheels-i686
160
154
161 .PHONY: linux-wheels-x86_64
155 .PHONY: linux-wheels-x86_64
162 linux-wheels-x86_64:
156 linux-wheels-x86_64:
163 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh
157 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh
164
158
165 .PHONY: linux-wheels-i686
159 .PHONY: linux-wheels-i686
166 linux-wheels-i686:
160 linux-wheels-i686:
167 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh
161 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh
@@ -1,16 +1,16 b''
1 FROM debian:__CODENAME__
1 FROM debian:%CODENAME%
2
2
3 RUN groupadd -g 1000 build && \
3 RUN groupadd -g 1000 build && \
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
5
5
6 RUN apt-get update && apt-get install -y \
6 RUN apt-get update && apt-get install -y \
7 build-essential \
7 build-essential \
8 debhelper \
8 debhelper \
9 devscripts \
9 devscripts \
10 dh-python \
10 dh-python \
11 less \
11 less \
12 python \
12 python \
13 python-all-dev \
13 python-all-dev \
14 python-docutils \
14 python-docutils \
15 unzip \
15 unzip \
16 zip
16 zip
@@ -1,16 +1,16 b''
1 FROM ubuntu:__CODENAME__
1 FROM ubuntu:%CODENAME%
2
2
3 RUN groupadd -g 1000 build && \
3 RUN groupadd -g 1000 build && \
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
4 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
5
5
6 RUN apt-get update && apt-get install -y \
6 RUN apt-get update && apt-get install -y \
7 build-essential \
7 build-essential \
8 debhelper \
8 debhelper \
9 devscripts \
9 devscripts \
10 dh-python \
10 dh-python \
11 less \
11 less \
12 python \
12 python \
13 python-all-dev \
13 python-all-dev \
14 python-docutils \
14 python-docutils \
15 unzip \
15 unzip \
16 zip
16 zip
@@ -1,37 +1,40 b''
1 #!/bin/bash -eu
1 #!/bin/bash -eu
2
2
3 . $(dirname $0)/packagelib.sh
3 . $(dirname $0)/packagelib.sh
4
4
5 BUILDDIR=$(dirname $0)
5 BUILDDIR=$(dirname $0)
6 export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd)
6 export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd)
7
7
8 DISTID="$1"
8 DISTID="$1"
9 CODENAME="$2"
9 CODENAME="$2"
10 PLATFORM="$1-$2"
10 PLATFORM="$1-$2"
11 shift; shift # extra params are passed to build process
11 shift; shift # extra params are passed to build process
12
12
13 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
13 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
14 CONTAINER=hg-docker-$PLATFORM
14 CONTAINER=hg-docker-$PLATFORM
15
15
16 DOCKER=$($BUILDDIR/hg-docker docker-path)
16 DOCKER=$($BUILDDIR/hg-docker docker-path)
17
17
18 $BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER
18 $BUILDDIR/hg-docker build \
19 --build-arg CODENAME=$CODENAME \
20 $BUILDDIR/docker/$DISTID.template \
21 $CONTAINER
19
22
20 # debuild only appears to be able to save built debs etc to .., so we
23 # debuild only appears to be able to save built debs etc to .., so we
21 # have to share the .. of the current directory with the docker
24 # have to share the .. of the current directory with the docker
22 # container and hope it's writable. Whee.
25 # container and hope it's writable. Whee.
23 dn=$(basename $ROOTDIR)
26 dn=$(basename $ROOTDIR)
24
27
25 DBUILDUSER=build
28 DBUILDUSER=build
26
29
27 if [ $(uname) = "Darwin" ] ; then
30 if [ $(uname) = "Darwin" ] ; then
28 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
31 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
29 sh -c "cd /mnt/$dn && make clean && make local"
32 sh -c "cd /mnt/$dn && make clean && make local"
30 fi
33 fi
31 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
34 $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \
32 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
35 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@"
33 contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME
36 contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME
34 if [ $(uname) = "Darwin" ] ; then
37 if [ $(uname) = "Darwin" ] ; then
35 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
38 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
36 sh -c "cd /mnt/$dn && make clean"
39 sh -c "cd /mnt/$dn && make clean"
37 fi
40 fi
General Comments 0
You need to be logged in to leave comments. Login now