Patchwork D3760: packaging: don't write files for templatized Dockerfiles

login
register
mail settings
Submitter phabricator
Date June 25, 2018, 3:21 p.m.
Message ID <4f4ce670fd4681e2bf9afc7ef011baa9@localhost.localdomain>
Download mbox | patch
Permalink /patch/32420/
State Not Applicable
Headers show

Comments

phabricator - June 25, 2018, 3:21 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc8ef9d897e14: packaging: don&#039;t write files for templatized Dockerfiles (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3760?vs=9112&id=9286

REVISION DETAIL
  https://phab.mercurial-scm.org/D3760

AFFECTED FILES
  .hgignore
  contrib/packaging/Makefile
  contrib/packaging/docker/debian.template
  contrib/packaging/docker/ubuntu.template
  contrib/packaging/dockerdeb

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/contrib/packaging/dockerdeb b/contrib/packaging/dockerdeb
--- a/contrib/packaging/dockerdeb
+++ b/contrib/packaging/dockerdeb
@@ -15,7 +15,10 @@ 
 
 DOCKER=$($BUILDDIR/hg-docker docker-path)
 
-$BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER
+$BUILDDIR/hg-docker build \
+    --build-arg CODENAME=$CODENAME \
+    $BUILDDIR/docker/$DISTID.template \
+    $CONTAINER
 
 # debuild only appears to be able to save built debs etc to .., so we
 # have to share the .. of the current directory with the docker
diff --git a/contrib/packaging/docker/ubuntu.template b/contrib/packaging/docker/ubuntu.template
--- a/contrib/packaging/docker/ubuntu.template
+++ b/contrib/packaging/docker/ubuntu.template
@@ -1,4 +1,4 @@ 
-FROM ubuntu:__CODENAME__
+FROM ubuntu:%CODENAME%
 
 RUN groupadd -g 1000 build && \
     useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
diff --git a/contrib/packaging/docker/debian.template b/contrib/packaging/docker/debian.template
--- a/contrib/packaging/docker/debian.template
+++ b/contrib/packaging/docker/debian.template
@@ -1,4 +1,4 @@ 
-FROM debian:__CODENAME__
+FROM debian:%CODENAME%
 
 RUN groupadd -g 1000 build && \
     useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -47,50 +47,44 @@ 
 ppa:
 	./builddeb --source-only
 
-docker/debian-%: docker/debian.template
-	sed "s/__CODENAME__/$*/" $< > $@
-
 .PHONY: docker-debian-jessie
-docker-debian-jessie: docker/debian-jessie
+docker-debian-jessie:
 	./dockerdeb debian jessie
 
 .PHONY: docker-debian-stretch
-docker-debian-stretch: docker/debian-stretch
+docker-debian-stretch:
 	./dockerdeb debian stretch
 
-docker/ubuntu-%: docker/ubuntu.template
-	sed "s/__CODENAME__/$*/" $< > $@
-
 .PHONY: docker-ubuntu-trusty
-docker-ubuntu-trusty: docker/ubuntu-trusty
+docker-ubuntu-trusty:
 	./dockerdeb ubuntu trusty
 
 .PHONY: docker-ubuntu-trusty-ppa
-docker-ubuntu-trusty-ppa: docker/ubuntu-trusty
+docker-ubuntu-trusty-ppa:
 	./dockerdeb ubuntu trusty --source-only
 
 .PHONY: docker-ubuntu-xenial
-docker-ubuntu-xenial: docker/ubuntu-xenial
+docker-ubuntu-xenial:
 	./dockerdeb ubuntu xenial
 
 .PHONY: docker-ubuntu-xenial-ppa
-docker-ubuntu-xenial-ppa: docker/ubuntu-xenial
+docker-ubuntu-xenial-ppa:
 	./dockerdeb ubuntu xenial --source-only
 
 .PHONY: docker-ubuntu-artful
-docker-ubuntu-artful: docker/ubuntu-artful
+docker-ubuntu-artful:
 	./dockerdeb ubuntu artful
 
 .PHONY: docker-ubuntu-artful-ppa
-docker-ubuntu-artful-ppa: docker/ubuntu-artful
+docker-ubuntu-artful-ppa:
 	./dockerdeb ubuntu artful --source-only
 
 .PHONY: docker-ubuntu-bionic
-docker-ubuntu-bionic: docker/ubuntu-bionic
+docker-ubuntu-bionic:
 	./dockerdeb ubuntu bionic
 
 .PHONY: docker-ubuntu-bionic-ppa
-docker-ubuntu-bionic-ppa: docker/ubuntu-bionic
+docker-ubuntu-bionic-ppa:
 	./dockerdeb ubuntu bionic --source-only
 
 .PHONY: fedora20
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -31,8 +31,6 @@ 
 contrib/chg/chg
 contrib/hgsh/hgsh
 contrib/vagrant/.vagrant
-contrib/packaging/docker/debian-*
-contrib/packaging/docker/ubuntu-*
 dist
 packages
 doc/common.txt