summaryrefslogtreecommitdiff
path: root/src/buildstream/_frontend/cli.py
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-06-11 17:15:16 +0100
committerRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-06-24 10:21:24 +0100
commit7372381f42d6982b584e9d1176f1269728aebf1b (patch)
treec514f79753915b2a083d1ef1c0e76db3aba65da1 /src/buildstream/_frontend/cli.py
parentd97ccf47dc2e03f13dff853ccaa3a84a345cdda2 (diff)
downloadbuildstream-7372381f42d6982b584e9d1176f1269728aebf1b.tar.gz
cli.py/_stream.py: Add pull option to checkout
This will set up a pull queue and pull relevant artifacts if not present or incomplete. Part of #1044
Diffstat (limited to 'src/buildstream/_frontend/cli.py')
-rw-r--r--src/buildstream/_frontend/cli.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 2301fcb78..b353ced93 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -950,13 +950,16 @@ def artifact():
help="Create a tarball from the artifact contents instead "
"of a file tree. If LOCATION is '-', the tarball "
"will be dumped to the standard output.")
+@click.option('--pull', 'pull_', default=False, is_flag=True,
+ help="Whether to pull the artifact if it's missing or "
+ "incomplete.")
@click.option('--directory', default=None,
type=click.Path(file_okay=False),
help="The directory to checkout the artifact to")
@click.argument('element', required=False,
type=click.Path(readable=False))
@click.pass_obj
-def artifact_checkout(app, force, deps, integrate, hardlinks, tar, directory, element):
+def artifact_checkout(app, force, deps, integrate, hardlinks, tar, pull_, directory, element):
"""Checkout contents of an artifact
When this command is executed from a workspace directory, the default
@@ -1002,7 +1005,8 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, directory, el
scope=scope,
integrate=True if integrate is None else integrate,
hardlinks=hardlinks,
- tar=tar)
+ tar=tar,
+ pull=pull_)
################################################################