diff --git a/.changes/unreleased/Under the Hood-20230119-211040.yaml b/.changes/unreleased/Under the Hood-20230119-211040.yaml new file mode 100644 index 00000000000..2968fa6b6dc --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230119-211040.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: dbt docs generate works with new click framework +time: 2023-01-19T21:10:40.698851-05:00 +custom: + Author: michelleark + Issue: "5543" diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py index 7fc1455046d..57dc01f4aa6 100644 --- a/core/dbt/cli/main.py +++ b/core/dbt/cli/main.py @@ -20,6 +20,7 @@ from dbt.task.freshness import FreshnessTask from dbt.task.run_operation import RunOperationTask from dbt.task.build import BuildTask +from dbt.task.generate import GenerateTask # CLI invocation @@ -175,10 +176,16 @@ def docs(ctx, **kwargs): @p.vars @p.version_check @requires.preflight +@requires.profile +@requires.project def docs_generate(ctx, **kwargs): """Generate the documentation website for your project""" - click.echo(f"`{inspect.stack()[0][3]}` called\n flags: {ctx.obj['flags']}") - return None, True + config = RuntimeConfig.from_parts(ctx.obj["project"], ctx.obj["profile"], ctx.obj["flags"]) + task = GenerateTask(ctx.obj["flags"], config) + + results = task.run() + success = task.interpret_results(results) + return results, success # dbt docs serve