aviv
09/12/2024, 11:14 AMDeployment.build_from_flow
and I want to deploy it with environment variables from my .env file.
Is there a way to do it while creating the work pool?
Or the only way to do it is with the job_variables
argument? what is the best practice of this case?
This is how I create the work pool:
prefect work-pool create localhost-tests --type process
this is my current deployment script:
deployment = Deployment.build_from_flow(
flow=flow,
name=f"{flow.name}",
work_pool_name="localhost-tests",
job_variables={
"env": dict(env.to_dict())
},
)
deployment.apply()