Skip to content

Commit

Permalink
optionally include cluster mapping in sync command (closes #84)
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed May 11, 2023
1 parent 3ca9658 commit 75365b0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/tagpack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,22 @@ def sync_repos(args):
print("Calc Quality metrics ...")
exec_cli_command(["quality", "calculate", "-u", args.url])

if args.run_cluster_mapping_with_env:
print("Import cluster mappings ...")
exec_cli_command(
[
"tagstore",
"insert_cluster_mappings",
"-u",
args.url,
"--use-gs-lib-config-env",
args.run_cluster_mapping_with_env,
]
)

print("Refreshing db views ...")
exec_cli_command(["tagstore", "refresh_views", "-u", args.url])

print_success("Your tagstore is now up-to-date again.")

else:
Expand Down Expand Up @@ -1092,6 +1108,10 @@ def print_help_subparser(subparser, args):
parser_syc.add_argument(
"-u", "--url", help="postgresql://user:password@db_host:port/database"
)
parser_syc.add_argument(
"--run-cluster-mapping-with-env",
help="Environment in graphsense-lib config" " to use for the mapping process",
)
parser_syc.set_defaults(func=sync_repos, url=def_url)

# parsers for tagpack command
Expand Down

0 comments on commit 75365b0

Please sign in to comment.