summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/main.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-07-13 16:43:46 +0000
committerJürg Billeter <j@bitron.ch>2017-08-02 11:29:31 +0100
commitb86c9a5cbff7335aa45e0a012e82026c41fde033 (patch)
treed165c48eda20e7dfd223f9a2248dd036ecba77ce /buildstream/_frontend/main.py
parente28852ee2cf0aaafd4e17df9156e8e167e6c8d38 (diff)
downloadbuildstream-sam/bst-push.tar.gz
Add initial `bst push` commandsam/bst-push
This is mainly useful for testing artifact caches and such. Most users will hopefully be able to make use of artifact caches populated by automated build machines, but right now it's unlikely that most people will be pushing artifacts around.
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 79adf11d7..43cdc431f 100644
--- a/buildstream/_frontend/main.py
+++ b/buildstream/_frontend/main.py
@@ -209,6 +209,37 @@ def track(app, target, variant, deps, except_):
##################################################################
+# Push Command #
+##################################################################
+@cli.command(short_help="Push 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 push(app, target, variant, deps):
+ """Push a built artifact to the configured remote artifact cache.
+
+ Specify `--deps` to control which artifacts to push:
+
+ \b
+ none: No dependencies, just the element itself
+ all: All dependencies
+ """
+ app.initialize(target, variant)
+ try:
+ to_push = app.pipeline.deps_elements(deps)
+ app.pipeline.push(app.scheduler, to_push)
+ click.echo("")
+ except _BstError as e:
+ click.echo("")
+ click.echo("ERROR: {}".format(e))
+ sys.exit(-1)
+
+
+##################################################################
# Show Command #
##################################################################
@cli.command(short_help="Show elements in the pipeline")