Fossil SCM

Added the container-image and container-run top-level build targets to manage dependencies better and to auto-version the build products.

wyoung 2022-08-15 23:21 trunk
Commit 67386c75f539a0d640b3d073dba8538dd02aef53df10ab7f5fd9ddcc7ca347d0
2 files changed +12 -1 +18
+12 -1
--- Makefile.in
+++ Makefile.in
@@ -113,8 +113,19 @@
113113
# but Makefile won't change, so we'll reconfig but... endlessly.
114114
#
115115
# This is also why we repeat the reconfig target's command here instead
116116
# of delegating to it with "$(MAKE) reconfig": having children running
117117
# around interfering makes this failure mode even worse.
118
-Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@ @srcdir@/Dockerfile.in
118
+Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
119119
@AUTOREMAKE@
120120
touch @builddir@/Makefile
121
+
122
+# Container stuff
123
+container-image: @srcdir@/Dockerfile
124
+ docker build -t fossil:@FOSSIL_CI_PFX@ $(DBFLAGS) @srcdir@
125
+
126
+container-run: container
127
+ docker run --name fossil-@FOSSIL_CI_PFX@ $(DRFLAGS) fossil:@FOSSIL_CI_PFX@
128
+
129
+@srcdir@/Dockerfile: @srcdir@/Dockerfile.in @srcdir@/manifest.uuid
130
+ @AUTOREMAKE@
131
+
121132
--- Makefile.in
+++ Makefile.in
@@ -113,8 +113,19 @@
113 # but Makefile won't change, so we'll reconfig but... endlessly.
114 #
115 # This is also why we repeat the reconfig target's command here instead
116 # of delegating to it with "$(MAKE) reconfig": having children running
117 # around interfering makes this failure mode even worse.
118 Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@ @srcdir@/Dockerfile.in
119 @AUTOREMAKE@
120 touch @builddir@/Makefile
 
 
 
 
 
 
 
 
 
 
 
121
--- Makefile.in
+++ Makefile.in
@@ -113,8 +113,19 @@
113 # but Makefile won't change, so we'll reconfig but... endlessly.
114 #
115 # This is also why we repeat the reconfig target's command here instead
116 # of delegating to it with "$(MAKE) reconfig": having children running
117 # around interfering makes this failure mode even worse.
118 Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
119 @AUTOREMAKE@
120 touch @builddir@/Makefile
121
122 # Container stuff
123 container-image: @srcdir@/Dockerfile
124 docker build -t fossil:@FOSSIL_CI_PFX@ $(DBFLAGS) @srcdir@
125
126 container-run: container
127 docker run --name fossil-@FOSSIL_CI_PFX@ $(DRFLAGS) fossil:@FOSSIL_CI_PFX@
128
129 @srcdir@/Dockerfile: @srcdir@/Dockerfile.in @srcdir@/manifest.uuid
130 @AUTOREMAKE@
131
132
--- www/build.wiki
+++ www/build.wiki
@@ -271,10 +271,28 @@
271271
272272
Our stock <tt>Dockerfile</tt> configures Fossil with the default feature
273273
set, so you may wish to modify the <tt>Dockerfile</tt> to add
274274
configuration options, add APK packages to support those options, and so
275275
forth.
276
+
277
+There are two convenience targets for you, <tt>make container-image</tt>
278
+and <tt>make container-run</tt>. The first creates a versioned container
279
+image, and the second does that and then launches a fresh container
280
+based on that image. You can pass extra arguments to the first command
281
+via the Makefile's <tt>DBFLAGS</tt> variable and to the second with the
282
+<tt>DRFLAGS</tt> variable. To get the custom port setting as in second
283
+command above, say:
284
+
285
+<pre><code> $ make container-run DRFLAGS='-p 9999:8080/tcp'</code></pre>
286
+
287
+Contrast the raw "<tt>docker</tt>" commands above, which create an
288
+<i>unversioned</i> image called <tt>fossil:latest</tt> and from that a
289
+container simply called <tt>fossil</tt>. The unversioned names are more
290
+convenient for interactive use, while the versioned ones are good for
291
+CI/CD type applications since they avoid a conflict with past versions;
292
+it lets you keep old containers around for quick roll-backs while
293
+replacing them with fresh ones.
276294
277295
278296
<h3 id="docker-storage">5.1 Repository Storage Options</h3>
279297
280298
If you want the container to serve an existing repository, there are at
281299
--- www/build.wiki
+++ www/build.wiki
@@ -271,10 +271,28 @@
271
272 Our stock <tt>Dockerfile</tt> configures Fossil with the default feature
273 set, so you may wish to modify the <tt>Dockerfile</tt> to add
274 configuration options, add APK packages to support those options, and so
275 forth.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
277
278 <h3 id="docker-storage">5.1 Repository Storage Options</h3>
279
280 If you want the container to serve an existing repository, there are at
281
--- www/build.wiki
+++ www/build.wiki
@@ -271,10 +271,28 @@
271
272 Our stock <tt>Dockerfile</tt> configures Fossil with the default feature
273 set, so you may wish to modify the <tt>Dockerfile</tt> to add
274 configuration options, add APK packages to support those options, and so
275 forth.
276
277 There are two convenience targets for you, <tt>make container-image</tt>
278 and <tt>make container-run</tt>. The first creates a versioned container
279 image, and the second does that and then launches a fresh container
280 based on that image. You can pass extra arguments to the first command
281 via the Makefile's <tt>DBFLAGS</tt> variable and to the second with the
282 <tt>DRFLAGS</tt> variable. To get the custom port setting as in second
283 command above, say:
284
285 <pre><code> $ make container-run DRFLAGS='-p 9999:8080/tcp'</code></pre>
286
287 Contrast the raw "<tt>docker</tt>" commands above, which create an
288 <i>unversioned</i> image called <tt>fossil:latest</tt> and from that a
289 container simply called <tt>fossil</tt>. The unversioned names are more
290 convenient for interactive use, while the versioned ones are good for
291 CI/CD type applications since they avoid a conflict with past versions;
292 it lets you keep old containers around for quick roll-backs while
293 replacing them with fresh ones.
294
295
296 <h3 id="docker-storage">5.1 Repository Storage Options</h3>
297
298 If you want the container to serve an existing repository, there are at
299

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button