Hi friends, We’re trying to use `prefect.yaml` an...
# ask-community
a
Hi friends, We’re trying to use
prefect.yaml
and
prefect deploy
in CI/CD and we’re having the following issue: • We have a directory containing multiple flows • In prefect.yaml, some of those flows have multiple deployments. • For a change in a given file we want to re-deploy all deployments related to that file. There doesn’t seem to be a way to do this. It’s either
prefect deploy --all
which deploys all deployments (disregarding the flow/file) or
prefect deploy <deployment_name>
but we have no way of knowing the deployment name given a single file can have arbitrarily multiple deployments. Does anyone know how to solve this? If something like this existed that could be what we need:
prefect deploy flows/flow1.py:flow
such that it looks at that entrypoint and gets all deployments for it. This method signature does it exist, but it seems to want to create a new deployment instead of finding existing ones. Thanks for your advice.
a
Hey @Adam! You’re right that the
prefect deploy
command doesn’t have a clean way to deploy a flow with all the deploy configurations for just that flow. We’d really appreciate it if you opened an issue describing what you’re trying to accomplish so we can look into implementing a feature to address your use case in the future! Unfortunately, there isn’t a clean way to work around this, but you could write a script that accepts a flow file, finds all the deploy configs in the
deployments
section your
prefect.yaml
file that have an
entrypoint
pointing to a flow in that file, and output a list of deploy config names or a full CLI command that you can run to update only those deployments.
a
Sure, here you go: https://github.com/PrefectHQ/prefect/issues/10459 @Bianca Hoch to discuss in our next call too.