Hi All, we have three environments: DEV,QA and Pr...
# prefect-community
d
Hi All, we have three environments: DEV,QA and Production and have corresponding docker images that contain dbt source codes. A prefect flow is used to run these dbt codes. The flow uses dockerrun. but dockerrun requires docker image name and label. and the image name and label are flow metadata. How can I use one flow for all these three environments?
a
Check out this page - it provides several ways to tackle this
💯 1
d
In that code, it uses secret but the secret applies to all flows in all projects. I have three projects for three environments. I would like the flow in dev project using image with label DEV and same flow in QA project using image with label QA etc. And flow code is pulled from git.
Although I could change docker image name and label before flow runs, It doesn't work on scheduled flow. Scheduled flow uses default run configuration
a
perhaps you can use the project name from the Prefect context to solve it?
Copy code
prefect.context.get("project_id")
# or
prefect.context.get("project_name")
d
That's a great idea! I'll try it.