<@ULVA73B9P> we're deploying our flows in CI with ...
# ask-marvin
d
@Marvin we're deploying our flows in CI with the prefect cli using a command like
prefect deploy --all --prefect-file prefect-prod.yaml
, but if something goes wrong with the deploy to prefect our CI reports it as a success, I believe because the prefect process returns a normal exit code. Is there a way of having prefect return an error when a deploy doesn't succeed so our CI can pick it up and report a failure?
m
It seems you're facing an issue with the
prefect deploy
command not returning a non-zero exit code upon failure, which makes your CI system mistakenly report success. Unfortunately, the Prefect documentation and GitHub issues do not provide a direct solution for configuring exit codes for deployment failures. However, here are a few potential workarounds you might consider: 1. Check Logs for Errors: Implement a script in your CI pipeline that checks the logs of the deployment for known error messages or patterns. If such errors are detected, manually set the CI job to fail. 2. Custom Error Handling: You could wrap the
prefect deploy
command in a custom script that inspects the output and determines success or failure based on specific conditions. 3. Use Prefect API for Verification: After deployment, use the Prefect API to verify the deployment status. If the deployment isn't successful, you can then trigger a failure in your CI pipeline. 4. GitHub Issues for Updates: Keep an eye on Prefect's GitHub issues for any updates or related discussions, as this could be a feature that may be addressed in future releases. For now, these workarounds might help you achieve the desired behavior until Prefect potentially implements a more robust solution for handling deployment failures with appropriate exit codes. If you need more specific guidance on implementing one of these workarounds, feel free to ask!