konveyor/tackle-data-gravity-insights

Get Neo4j URL as a parameter or env var

Closed this issue · 0 comments

Currently dgi requires that the environment variable: NEO4J_BOLT_URL be set before running the command so that it can find the Neo4j graphdb server, in order to populate the graph. It would be nice if this could also be passed into the command line interface as a parameter.

Recommendation

Click has the capability of getting CLI parameters from the environment. We should implement something like this:

@click.option("--neo4j-bolt", "-n", envvar="NEO4J_BOLT_URL", default="bolt://neo4j:test@localhost:7687", help="Neo4j Bolt URL")

This would allow users to specify the bolt url on the command line but would also pick up the environment variable if not specified as a parameter. It would also default to Neo4j running on localhost which is how most people will use it when first trying it out by following the getting started guide.