diff options
author | Jürg Billeter <j@bitron.ch> | 2017-06-23 11:20:40 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-06-27 10:30:29 +0200 |
commit | 2dc7e22fd13dfa385ee795442104e96b5bd19288 (patch) | |
tree | 627f52e3a78cdeed02c30bf6c1f3b018bca6bf49 /buildstream/_ostree.py | |
parent | 8c857b63011743948e962fca0eb301cf183b71c9 (diff) | |
download | buildstream-2dc7e22fd13dfa385ee795442104e96b5bd19288.tar.gz |
_ostree.py: Support local artifact sharing
Diffstat (limited to 'buildstream/_ostree.py')
-rw-r--r-- | buildstream/_ostree.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py index edf646e4f..1dfc934b3 100644 --- a/buildstream/_ostree.py +++ b/buildstream/_ostree.py @@ -302,16 +302,21 @@ def fetch_ssh(repo, remote, ref): # ref (str): A ref to push # def push(repo, remote, ref): - exit_code, output = utils._call([ - _site.ostree_push, - '--repo=' + repo.get_path().get_path(), - remote, - ref], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - if exit_code: - raise OSTreeError("Failed to push artifact to remote SSH repository:\n{}".format(output)) + if remote.startswith("/"): + # local repository + push_repo = ensure(remote, True) + fetch(push_repo, remote=repo.get_path().get_uri(), ref=ref) + else: + exit_code, output = utils._call([ + _site.ostree_push, + '--repo=' + repo.get_path().get_path(), + remote, + ref], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + if exit_code: + raise OSTreeError("Failed to push artifact to remote SSH repository:\n{}".format(output)) # configure_remote(): |