Patchwork [1,of,6,STABLE,V3] make: turn ubuntu docker into template

login
register
mail settings
Submitter Sean Farley
Date April 29, 2016, 9:01 p.m.
Message ID <205ca71c0924de454462.1461963700@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/14841/
State Accepted
Commit e63dfbbdbd078a6c822e1903c298783d261eee82
Headers show

Comments

Sean Farley - April 29, 2016, 9:01 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1461738797 25200
#      Tue Apr 26 23:33:17 2016 -0700
# Branch stable
# Node ID 205ca71c0924de45446209ed4fe1fc6ac44056c5
# 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.

Patch

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,12 +173,14 @@  ppa:
 
 docker-debian-jessie:
 	mkdir -p packages/debian-jessie
 	contrib/dockerdeb debian jessie
 
-docker-ubuntu-trusty:
-	mkdir -p packages/ubuntu-trusty
+contrib/docker/ubuntu-%: contrib/docker/ubuntu.template
+	sed "s/__CODENAME__/$*/" $< > $@
+
+docker-ubuntu-trusty: contrib/docker/ubuntu-trusty
 	contrib/dockerdeb ubuntu trusty
 
 fedora20:
 	mkdir -p packages/fedora20
 	contrib/buildrpm
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
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