Fix missing mount for git reference and change a little how ccache is done.
authorCarl Hetherington <cth@carlh.net>
Thu, 4 Jun 2020 14:02:30 +0000 (16:02 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 4 Jun 2020 14:02:30 +0000 (16:02 +0200)
cdist

diff --git a/cdist b/cdist
index bd64e77239c9663c5a28d1483121d93e484f3941..1aff482f92954f4cc653e8c4fe7259c1f618b2ed 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -548,8 +548,10 @@ class DockerTarget(Target):
             opts += '-v %s:%s ' % (m, m)
         if self.privileged:
             opts += '--privileged=true '
+        if config.has('git_reference'):
+            opts += '-v %s:%s ' % (config.get('git_reference'), config.get('git_reference'))
         if self.ccache:
-            opts += "-e CCACHE_DIR=/ccache --volumes-from ccache-%s" % self.image
+            opts += "-e CCACHE_DIR=/ccache/%s --mount source=ccache,target=/ccache" % self.image
 
         tag = self.image
         if config.has('docker_hub_repository'):