summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/main.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-08-01 14:22:02 +0100
committerJürg Billeter <j@bitron.ch>2017-08-02 11:30:29 +0100
commit3f0417c9ffbe2e6f86ae180169908e92f9622133 (patch)
treedfb935dcb8ac3c693582457c3fee009368916926 /buildstream/_frontend/main.py
parentb86c9a5cbff7335aa45e0a012e82026c41fde033 (diff)
downloadbuildstream-bst-pull.tar.gz
Add initial `bst pull` commandbst-pull
Diffstat (limited to 'buildstream/_frontend/main.py')
-rw-r--r--buildstream/_frontend/main.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py
index 43cdc431f..4eb785107 100644
--- a/buildstream/_frontend/main.py
+++ b/buildstream/_frontend/main.py
@@ -209,6 +209,37 @@ def track(app, target, variant, deps, except_):
##################################################################
+# Pull Command #
+##################################################################
+@cli.command(short_help="Pull a built artifact")
+@click.option('--variant',
+ help='A variant of the specified target')
+@click.option('--deps', '-d', default='none',
+ type=click.Choice(['none', 'all']),
+ help='The dependencies to fetch (default: none)')
+@click.argument('target')
+@click.pass_obj
+def pull(app, target, variant, deps):
+ """Pull a built artifact from the configured remote artifact cache.
+
+ Specify `--deps` to control which artifacts to pull:
+
+ \b
+ none: No dependencies, just the element itself
+ all: All dependencies
+ """
+ app.initialize(target, variant)
+ try:
+ to_pull = app.pipeline.deps_elements(deps)
+ app.pipeline.pull(app.scheduler, to_pull)
+ click.echo("")
+ except _BstError as e:
+ click.echo("")
+ click.echo("ERROR: {}".format(e))
+ sys.exit(-1)
+
+
+##################################################################
# Push Command #
##################################################################
@cli.command(short_help="Push a built artifact")