[PATCH 1 of 6 STABLE V2] make: turn ubuntu docker into template

Sean Farley sean at farley.io
Wed Apr 27 18:12:04 UTC 2016


# HG changeset patch
# User Sean Farley <sean at farley.io>
# Date 1461738797 25200
#      Tue Apr 26 23:33:17 2016 -0700
# Branch stable
# Node ID f2e879f9f08606a580dfb55e9ac1c6d8d9caf649
# Parent  87d4a6c5567e81386b8c2209d95060d5bf72e064
# EXP-Topic docker-ppa
make: turn ubuntu docker into template

This allows us to easily add more ubuntu docker targets (which following
patches will do).

Also, we no longer need the mkdir command.

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -28,10 +28,11 @@ tests/*.err
 tests/htmlcov
 build
 contrib/chg/chg
 contrib/hgsh/hgsh
 contrib/vagrant/.vagrant
+contrib/docker/ubuntu-*
 dist
 packages
 doc/common.txt
 doc/*.[0-9]
 doc/*.[0-9].txt
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -173,13 +173,16 @@ ppa:
 
 docker-debian-jessie:
 	mkdir -p packages/debian-jessie
 	contrib/dockerdeb debian jessie
 
-docker-ubuntu-trusty:
-	mkdir -p packages/ubuntu-trusty
-	contrib/dockerdeb ubuntu trusty
+docker-ubuntu-gen:
+	sed "s/__CODENAME__/$(CODENAME)/" contrib/docker/ubuntu-template > contrib/docker/ubuntu-$(CODENAME)
+
+docker-ubuntu-trusty: CODENAME=trusty
+docker-ubuntu-trusty: docker-ubuntu-gen
+	contrib/dockerdeb ubuntu $(CODENAME)
 
 fedora20:
 	mkdir -p packages/fedora20
 	contrib/buildrpm
 	cp rpmbuild/RPMS/*/* packages/fedora20
diff --git a/contrib/docker/ubuntu-template b/contrib/docker/ubuntu-template
new file mode 100644
--- /dev/null
+++ b/contrib/docker/ubuntu-template
@@ -0,0 +1,11 @@
+FROM ubuntu:__CODENAME__
+RUN apt-get update && apt-get install -y \
+  build-essential \
+  debhelper \
+  dh-python \
+  devscripts \
+  python \
+  python-all-dev \
+  python-docutils \
+  zip \
+  unzip
diff --git a/contrib/docker/ubuntu-trusty b/contrib/docker/ubuntu-trusty
deleted file mode 100644
--- a/contrib/docker/ubuntu-trusty
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM ubuntu:trusty
-RUN apt-get update && apt-get install -y \
-  build-essential \
-  debhelper \
-  dh-python \
-  devscripts \
-  python \
-  python-all-dev \
-  python-docutils \
-  zip \
-  unzip


More information about the Mercurial-devel mailing list