mirror of https://github.com/m-labs/artiq.git
client: add --async option to scan-repository, recommend usage in git post-receive
This commit is contained in:
parent
f9db7e472b
commit
eba90c8782
|
@ -96,6 +96,8 @@ def get_argparser():
|
||||||
|
|
||||||
parser_scan_repos = subparsers.add_parser(
|
parser_scan_repos = subparsers.add_parser(
|
||||||
"scan-repository", help="trigger a repository (re)scan")
|
"scan-repository", help="trigger a repository (re)scan")
|
||||||
|
parser_scan_repos.add_argument("--async", action="store_true",
|
||||||
|
help="trigger scan and return immediately")
|
||||||
parser_scan_repos.add_argument("revision", default=None, nargs="?",
|
parser_scan_repos.add_argument("revision", default=None, nargs="?",
|
||||||
help="use a specific repository revision "
|
help="use a specific repository revision "
|
||||||
"(defaults to head)")
|
"(defaults to head)")
|
||||||
|
@ -159,7 +161,10 @@ def _action_scan_devices(remote, args):
|
||||||
|
|
||||||
|
|
||||||
def _action_scan_repository(remote, args):
|
def _action_scan_repository(remote, args):
|
||||||
remote.scan_repository(args.revision)
|
if args.async:
|
||||||
|
remote.scan_repository_async(args.revision)
|
||||||
|
else:
|
||||||
|
remote.scan_repository(args.revision)
|
||||||
|
|
||||||
|
|
||||||
def _action_ls(remote, args):
|
def _action_ls(remote, args):
|
||||||
|
|
|
@ -93,7 +93,7 @@ There should be no errors displayed, and if you start the GUI again you should n
|
||||||
First, another small configuration step is needed. We must tell Git to make the master rescan the repository when new data is added to it. Create a file ``~/artiq-master/repository/hooks/post-receive`` with the following contents: ::
|
First, another small configuration step is needed. We must tell Git to make the master rescan the repository when new data is added to it. Create a file ``~/artiq-master/repository/hooks/post-receive`` with the following contents: ::
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
artiq_client scan-repository
|
artiq_client scan-repository --async
|
||||||
|
|
||||||
Then set the execution permission on it: ::
|
Then set the execution permission on it: ::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue