diff options
author | Mathieu Bridon <bochecha@daitauha.fr> | 2017-09-09 11:57:23 +0200 |
---|---|---|
committer | Mathieu Bridon <bochecha@daitauha.fr> | 2017-09-19 09:34:00 +0200 |
commit | e1da62e4eccf94a11e60d972f87aa03b413ac350 (patch) | |
tree | 44258786fdfdfc419d30a678b8bf67718442dfb4 /buildstream/_artifactcache/artifactcache.py | |
parent | 606ce8fa46f7d5bc45763388fa721a8a633759f5 (diff) | |
download | buildstream-e1da62e4eccf94a11e60d972f87aa03b413ac350.tar.gz |
Let projects configure their artifacts pull/push options
With this commit, we first look at the artifacts options in the project
configuration, then fall back on the user configuration if necessary.
Relates to #87
Diffstat (limited to 'buildstream/_artifactcache/artifactcache.py')
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index 1f643ca45..41625b655 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -52,9 +52,10 @@ def buildref(element, key): # # Args: # context (Context): The BuildStream context +# project (Project): The BuildStream project # class ArtifactCache(): - def __init__(self, context): + def __init__(self, context, project): self.context = context @@ -66,9 +67,15 @@ class ArtifactCache(): self.__pull_local = False self.__push_local = False - self.artifact_pull = context.artifact_pull - self.artifact_push = context.artifact_push - self.artifact_push_port = context.artifact_push_port + if any((project.artifact_pull, project.artifact_push)): + self.artifact_pull = project.artifact_pull + self.artifact_push = project.artifact_push + self.artifact_push_port = project.artifact_push_port + + else: + self.artifact_pull = context.artifact_pull + self.artifact_push = context.artifact_push + self.artifact_push_port = context.artifact_push_port if self.artifact_push: if self.artifact_push.startswith("/") or \ |