summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-03 22:06:44 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-03 22:06:44 +0900
commitd8c73962fdb6756e5fd299e82d089bb9c349ecef (patch)
tree1dd8a5428c74a7b2c4e6f7cce47cad162ced7225
parent70cc9515d392cb859d99135c847f67fb926b42ed (diff)
downloadbuildstream-d8c73962fdb6756e5fd299e82d089bb9c349ecef.tar.gz
_artifactcache.py: Use the new mountdir options to ostree push/pull APIs
Instead of mounting in CWD, mount in the ${artifactdir}/mounts directory.
-rw-r--r--buildstream/_artifactcache.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py
index 92b9ad617..a486307cb 100644
--- a/buildstream/_artifactcache.py
+++ b/buildstream/_artifactcache.py
@@ -187,7 +187,10 @@ class ArtifactCache():
elif self.context.artifact_share.startswith("/"):
_ostree.fetch(self.repo, remote="file://" + self.context.artifact_share, ref=ref)
else:
- _ostree.fetch_ssh(self.repo, remote=self.context.artifact_share, ref=ref)
+ mountdir = os.path.join(self.context.artifactdir, 'mounts')
+ os.makedirs(mountdir, exist_ok=True)
+
+ _ostree.fetch_ssh(self.repo, mountdir, remote=self.context.artifact_share, ref=ref)
# can_push():
#
@@ -207,5 +210,7 @@ class ArtifactCache():
#
def push(self, element):
ref = buildref(element)
+ mountdir = os.path.join(self.context.artifactdir, 'mounts')
+ os.makedirs(mountdir, exist_ok=True)
- _ostree.push(self.repo, remote=self.context.artifact_share, ref=ref)
+ _ostree.push(self.repo, mountdir, remote=self.context.artifact_share, ref=ref)