Joshua Hansen
09/05/2023, 5:43 PMNate
09/05/2023, 8:42 PMprefect deployment build
UX for block-based deployments
I'd recommend using `prefect.yaml` to define your deployments and then prefect deploy
something like this
the example i just linked might be slightly overcomplicated (im checking for modified files and dynamically iterating over them)
but in general you want to
⢠set your PREFECT_API_URL in the env so your CI machine can talk to the server
⢠run prefect --no-prompt deploy myfile.py:my_flow_function
for each flow you want to deploy ( or prefect --no-prompt deploy --all
to deploy them all) The --no-prompt
part is important for CI because it means "turn off interactive mode"run this (lets say on merge) and any changes to code/deploy-config would overwrite the existing deployment by name?but yes this sounds right, your CI could generate a
version
(commonly a Git SHA) to attach to the deployment if you need to differentiateJoshua Hansen
09/05/2023, 8:46 PMNate
09/05/2023, 8:53 PMa quick glance it seems it'd be preferred to use the declarative yaml, be smart in the CI step about which things require deployment and go from there.I agree - this has been the easiest way in my experience, you can fully leverage the templating options in
prefect.yaml
and then handle your specific version control strategy / selective deployment within CI