You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:40:35 UTC
[buildstream] 02/07: Add no-fetch flag for 'bst push' command
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch gokcen/no_auto_fetch
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit bf827ed2320b2a00c223e9278c17331fbdfa169a
Author: Gökçen Nurlu <gn...@bloomberg.net>
AuthorDate: Thu Oct 25 18:38:44 2018 +0100
Add no-fetch flag for 'bst push' command
---
buildstream/_frontend/cli.py | 6 ++++--
buildstream/_stream.py | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 99054fe..f45ffb0 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -464,8 +464,10 @@ def pull(app, elements, deps, remote, no_fetch):
help="The URL of the remote cache (defaults to the first configured cache)")
@click.argument('elements', nargs=-1,
type=click.Path(readable=False))
+@click.option('--no-fetch', 'no_fetch', default=False, is_flag=True,
+ help="Disable auto-fetching of junction(s) automatically")
@click.pass_obj
-def push(app, elements, deps, remote):
+def push(app, elements, deps, remote, no_fetch):
"""Push a built artifact to a remote artifact cache.
The default destination is the highest priority configured cache. You can
@@ -478,7 +480,7 @@ def push(app, elements, deps, remote):
all: All dependencies
"""
with app.initialized(session_name="Push"):
- app.stream.push(elements, selection=deps, remote=remote)
+ app.stream.push(elements, selection=deps, remote=remote, no_fetch=no_fetch)
##################################################################
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 992b37a..cd69808 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -325,13 +325,15 @@ class Stream():
# targets (list of str): Targets to push
# selection (PipelineSelection): The selection mode for the specified targets
# remote (str): The URL of a specific remote server to push to, or None
+ # no_fetch (bool): Flag to disable auto-fetch of junctions needed by `targets`
#
# If `remote` specified as None, then regular configuration will be used
# to determine where to push artifacts to.
#
def push(self, targets, *,
selection=PipelineSelection.NONE,
- remote=None):
+ remote=None,
+ no_fetch):
use_config = True
if remote:
@@ -341,7 +343,7 @@ class Stream():
selection=selection,
use_artifact_config=use_config,
artifact_remote_url=remote,
- fetch_subprojects=True)
+ fetch_subprojects=not no_fetch)
if not self._artifacts.has_push_remotes():
raise StreamError("No artifact caches available for pushing artifacts")