diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-08-29 10:54:18 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-09-05 07:56:42 +0000 |
commit | 5529b914a2531f56a1bd694f66797341b488ab16 (patch) | |
tree | 86d20be945a86b7d352a83b0321b9e959c579d7b /src/buildstream | |
parent | d3cb30cecdccbdb65fea9d20989a57b461cfdeaf (diff) | |
download | buildstream-5529b914a2531f56a1bd694f66797341b488ab16.tar.gz |
cli.py: Allow push to handle artifact refs
This patch extends support for bst artifact push so that is now
able to handle artifact refs.
If --deps all is selected and a ref is given, BuildStream will
error.
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/_frontend/cli.py | 10 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py index e5325934c..c492254ce 100644 --- a/src/buildstream/_frontend/cli.py +++ b/src/buildstream/_frontend/cli.py @@ -1180,10 +1180,10 @@ def artifact_pull(app, elements, deps, remote): help='The dependencies to push') @click.option('--remote', '-r', default=None, help="The URL of the remote cache (defaults to the first configured cache)") -@click.argument('elements', nargs=-1, +@click.argument('artifacts', nargs=-1, type=click.Path(readable=False)) @click.pass_obj -def artifact_push(app, elements, deps, remote): +def artifact_push(app, artifacts, deps, remote): """Push a built artifact to a remote artifact cache. Specifying no elements will result in pushing the default targets @@ -1209,12 +1209,12 @@ def artifact_push(app, elements, deps, remote): with app.initialized(session_name="Push"): ignore_junction_targets = False - if not elements: - elements = app.project.get_default_targets() + if not artifacts: + artifacts = app.project.get_default_targets() # Junction elements cannot be pushed, exclude them from default targets ignore_junction_targets = True - app.stream.push(elements, selection=deps, remote=remote, + app.stream.push(artifacts, selection=deps, remote=remote, ignore_junction_targets=ignore_junction_targets) diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index f0e891dcf..5d5c355b1 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -455,7 +455,8 @@ class Stream(): selection=selection, ignore_junction_targets=ignore_junction_targets, use_artifact_config=use_config, - artifact_remote_url=remote) + artifact_remote_url=remote, + load_refs=True) if not self._artifacts.has_push_remotes(): raise StreamError("No artifact caches available for pushing artifacts") |