Hi there - So, I have two sets of on-run-end hook...
# community-support
a
Hi there - So, I have two sets of on-run-end hooks in play, the set from the
elementary
package and one bespoke one written for my team that lives in
dbt_project.yml
We have a post-hook to clean up temp schemas created on CI builds, but that's running before the post-hooks in the elementary package. In the CI job,
elementary
is looking for temporary schemas that no longer exist because our first post-hook dropped them. I see two possible solutions: • Running the schema dropping hook last. Only thing is I'm not sure how to do that since the hook definitions live in different
dbt_project.yml
files. I was looking through the post-hook docs on dbt and it looks like there is a set order in which they get run. • Would an alternate solution be to modify the
elementary
post-hook to NOT run when
target.name == 'ci'
. Is there a way to do that, and would that mess elementary up? Is it possible to skip
elementary
on CI builds?
o
Hi @Alex Fetterman! one possible solution I can think of is to disable elementary for the CI job by adding this to the dbt_project.yml under models -
Copy code
elementary:
  enabled: "{{ target.name != 'ci'}}"
a
Hi @Or Avidov Thank you! Would this be in my main dbt project's dbt_project.yml file, where we are specifying the schema the elementary models get built in? Think I figured it out! Thanks, this ought to work well for us.