-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-1357] [Feature] DBT_PROJECT_DIR env var #6078
Comments
Yeah! Hip, hip, hooray for the new CLI framework! Nothing better than a one-liner 💪
Agreed that this would be a good second issue for a motivated community contributor. I would affirm the option to wait until we've cut over to the new CLI If such a person doesn't emerge. |
Hi, @dbeatty10, @jtcohen6 - is it correct that it's not possible to use the extension today if I've tried numerous workarounds with no luck as of yet. Then I found this issue. 😄 Thanks! |
Yep, that sounds right @aaronsteers Let's say you have an environment variable named Then here's a couple options using zsh/bash:
Once this issue is resolved and included in a release, then you'd be able to do the following, no matter the current working directory: dbt build |
@dbeatty10 @jtcohen6 I created a PR for this. Can someone do a review on it? |
Co-authored-by: Jeremy Cohen <[email protected]>
Co-authored-by: Jeremy Cohen <[email protected]>
* ct-2198: clean up some type names and uses * CT-2198: Unify constraints and constraints_check properties on columns * Make mypy version consistently 0.981 (#7134) * CT 1808 diff based partial parsing (#6873) * model contracts on models materialized as views (#7120) * first pass * rename tests * fix failing test * changelog * fix functional test * Update core/dbt/parser/base.py * Update core/dbt/parser/schemas.py * Create method for env var deprecation (#7086) * update to allow adapters to change model name resolution in py models (#7115) * update to allow adapters to change model name resolution in py models * add changie * fix newline adds * move quoting into macro * use single quotes * add env DBT_PROJECT_DIR support #6078 (#6659) Co-authored-by: Jeremy Cohen <[email protected]> * Add new index.html and changelog yaml files from dbt-docs (#7141) * Make version configs optional (#7060) * [CT-1584] New top level commands: interactive compile (#7008) Co-authored-by: Github Build Bot <[email protected]> * CT-2198: Add changelog entry * CT-2198: Fix tests which broke after merge * CT-2198: Add explicit validation of constraint types w/ unit test * CT-2198: Move access property, per code review * CT-2198: Remove a redundant macro * CT-1298: Rework constraints to be adapter-generated in Python code * CT-2198: Clarify function name per review --------- Co-authored-by: Gerda Shank <[email protected]> Co-authored-by: Emily Rockman <[email protected]> Co-authored-by: Stu Kilgore <[email protected]> Co-authored-by: colin-rogers-dbt <[email protected]> Co-authored-by: Leo Schick <[email protected]> Co-authored-by: Jeremy Cohen <[email protected]> Co-authored-by: FishtownBuildBot <[email protected]> Co-authored-by: dave-connors-3 <[email protected]> Co-authored-by: Kshitij Aranke <[email protected]> Co-authored-by: Github Build Bot <[email protected]>
Is this your first time submitting a feature request?
Describe the feature
First proposed in #5411. Not included in initial implementation from #5717
It should be possible to set the
--project-dir
CLI flag via env var instead:DBT_PROJECT_DIR
It's very easy to do this using the new CLI framework:
dbt-core/core/dbt/cli/params.py
Lines 220 to 234 in 73aebd8
It's a bit trickier for the old framework. See prior art from
--profiles-dir
:dbt-core/core/dbt/main.py
Lines 1189 to 1201 in 73aebd8
We could consider waiting until we've cut over to the new CLI. (planned for v1.4 or v1.5)
Describe alternatives you've considered
Not doing this. It's a convenience (and consistency) thing. Given some recent comments on #5411, it sounds like this would help some people
Who will this benefit?
People who want to deploy dbt projects nested in subdirectories of larger repos, and want to set an env var once, rather than passing the
--project-dir
flag into every commandAre you interested in contributing this feature?
I think this could be a good second issue for a motivated community contributor!
Anything else?
No response
The text was updated successfully, but these errors were encountered: